My WordPress site always displays a cached version of its homepage

First of all, sorry if I’m making a mistake. I already asked this on the ServerFault forum, but got no answers at the moment and I thought it would be a good idea to ask the question here, considering that it is a WordPress specific question.

I have a WordPress site that runs fine, but there’s a strange behaviour: one a reader loads the page, the site shows a “cached” version of the site, with the same news and comment numbers that the reader viewed when he visited the site last time.

Read More

So every user has to reload the page (Ctrl+F5, Cmd+R) in order to get the “real”, and updated homepage.

I don’t know why this is happening. At the moment I’m not using any cache plugin, and my server is running Nginx+MySQL+PHP-FPM on a Ubuntu 10.04 LTS Linux VPS. Is there something I must change on the nginx config files, maybe?

Related posts

Leave a Reply

3 comments

  1. Sounds like your expires headers are set to far in the future. The following rules can be added to your .htaccess Expires rules can be added to your Nginx server file to shorten the expires time down to 180 seconds.

    location ~* /[^/]+/(feed|.xml|.html|.HTML)/? {
    
                   expires 180;
    }
    

    I would also suggest installing the Nginx Proxy Cache Integrator plugin to control the Nginx static file proxy cache.

    Another plugin that is similar is Nginx Proxy Cache Purge that purges the proxy cache anytime you update your site.

    The problem your having is NOT being caused by WordPress.

  2. ExpiresByType text/html “access plus 180 seconds”

    Adding this in htaccess will fix the issue. I too faced same kind of issue and above fixed it forever