You need to use WP Fastest Cache Plugin on WordPress
As it turns out Nginx does in fact perform a similar file_exists check on every single request it handles. Most configurations have the following block.
location / {
try_files $uri $uri/ /index.php?$args;
}
This essentially tells Nginx to serve the requested file if it exists, otherwise, perform an internal redirect to index.php. If we add our cache directory to this block, we can instruct Nginx to serve the cached HTML file directly without ever hitting PHP.
With that in mind, we can update our try_files directive like so:
nano /etc/nginx/sites-enabled/wordpress
try_files «/wp-content/cache/all/${http_host}${request_uri}index.html» $uri $uri/ /index.php?$args;
Save changes and reload Nginx
systemctl reload nginx.service
After reloading Nginx, any cached pages generated by WP Fastest Cache will be served directly from Nginx without ever hitting PHP. Requests which haven’t been cached will continue to be handled by WordPress, which will generate the cache for subsequent requests.
I should mention that I’ve disabled the ‘Enable Compression’ option in Simple Cache, because Nginx automatically compresses HTML files before sending them to the browser. This means generating the cache via PHP has slightly less overhead because it’s not having to GZIP the contents of the output buffer.
Now you can test the server speed
ab -n 1000 -c 100 https://www.krarup.cl/