Cache plugins: fixing refresh/update issues

Does your WordPress-based website sometimes not show new content after you make a new post or edit? Most likely it’s an issue with your cache plugin.1000px-View-refresh_Gion_simple.svg

Every time I tried to activate a cache plugin to speed up my site, I found repeat visitors were seeing the same content they saw a few days ago when they had first visited. I would disable the cache and the problem was fixed — but how could I get both the speed benefit of the cache plugin, and also have a functioning and updated site?

I did two things to fix this refresh issue:

  1. Removed the .htaccess code specifying “Leveraging browser cache” settings.
  2. Hit “Purge cache” in the cache plugin each time I updated content. (I had to also hit refresh once on my browser, just to reset the settings in the browser cache to forget the old “leveraging” settings — so although a few return visitors may have an older version of the site show up for a bit, going forward, I don’t think this will happen again. (Will update soon)

Question: Are you having issues with your site not showing updated content? Add a comment below if you’ve found a solution!

Here’s the code I removed from my .htaccess file:

ExpiresActive on
ExpiresByType text/css “access plus 14 days”
ExpiresByType text/xml “access plus 0 seconds”
ExpiresByType text/javascript “access plus 14 days”
ExpiresByType application/x-javascript “access plus 14 days”
ExpiresByType image/ico “access plus 14 days”
ExpiresByType image/jpg “access plus 14 days”
ExpiresByType image/jpeg “access plus 14 days”
ExpiresByType image/gif “access plus 14 days”
ExpiresByType image/png “access plus 14 days”
ExpiresByType image/svg+xml “access plus 1 month”
ExpiresByType text/html “access plus 14 days”
ExpiresByType video/ogg “access plus 1 month”
ExpiresByType audio/ogg “access plus 1 month”
ExpiresByType video/mp4 “access plus 1 month”
ExpiresByType video/webm “access plus 1 month”
ExpiresByType application/x-font-woff “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”
ExpiresByType application/xml “access plus 0 seconds”
ExpiresByType application/json “access plus 0 seconds”
ExpiresByType application/rss+xml “access plus 1 hour”
ExpiresByType application/atom+xml “access plus 1 hour”

Cache plugins: fixing refresh/update issues

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s