Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

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?

share|improve this question
    
this sounds like you have high expires set for your actual html/homepage which means that user is caching your homepage, can you paste your nginx config –  anthonysomerset Mar 7 '11 at 12:53
    
this should be migrated right back to serverfault - bizarre decision to move it –  anu Mar 8 '11 at 9:47
    
How is configured (if any) php cache, like APC? –  Marcin Mar 8 '11 at 12:11
add comment

3 Answers

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Go to http://web-sniffer.net/ and enter the URL of your site. Extend your question with the result of the tool.
Especially the Cache-Control and Expires headers are important. If they are set for a very long time your visitor’s browsers will often use their internal cache.

share|improve this answer
add comment

I had an issue like this and it was the WP Super Cache plugin. Try disabling it and if that works, check around the settings to see what's amiss.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.