0
votes

We are running an NGINX server and are experiencing strange caching behaviour. The site is Wordpress running Fastest Cache. The cache control on the response headers consistently says:

max-age=0, no-cache, no-store, must-revalidate

The website is [boxChilli][https://www.boxchilli.com/]

I have tried everything to get the site to cache correctly but I thought it best to throw this open to the community.

1

1 Answers

0
votes

Because the HTML files are not cached, so it says no-cache for html files, and its storing age as max-age:0 to indicate the contents are served from server always. But the rest of the contents should be cached, if nginx is configured as following.

Please try this tutorial written by me. I explained everything in detailed. http://nucuta.com/wp-fastest-cache-configuration-for-nginx/

Additionally use this in nginx.conf in /etc/nginx/ you don't have to mention text/html as html files are compressed in default.

gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

And in default file in /etc/nginx/sites-enabled/

location ~* \.(css|gif|ico|jpeg|jpg|js|png|woff|woff2|ttf|ttc|otf|eot)$ {
        expires max;
        log_not_found off;
    }