[Solved] Clearing browser caches after major site changes

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
janaf
Forum Members
Forum Members
Posts: 183
Joined: Sun Jan 10, 2010 7:02 pm

[Solved] Clearing browser caches after major site changes

Post by janaf »

I have just upgraded my site and made changes to the menue structure. I am not sure how the cache settings per page have been set.

Assume the pages they have cached already have a long timeout, then how do I refresh their pages?

Is there a way I can induce/force clearing the users browser cached pages?
Last edited by janaf on Mon Aug 08, 2011 9:17 pm, edited 1 time in total.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am

Re: Clearing browser caches after major site changes, how?

Post by fredp »

Hi,

It's not a perfect solution, but you might experiment with appending a new query string parameter to all the URLs on the site. A temporary .htaccess mod_rewrite rule might be a reasonable way to do this. You might then keep the rule in place until all the older content is set to expire, then remove it.

Off the top of my head (no warranty expressed or implied)...

Code: Select all

#Use at your own risk
RewriteCond %{QUERY_STRING} !^.*browsercacherev=.+$ [NC]
RewriteRule ^(.+?)$ $1?browsercacherev=20110804 [QSA,NC,L,R]
The name and value of the param are arbitrary. Modify as you deem appropriate for your situation.

Hope this helps,
fredp
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
Post Reply

Return to “The Lounge”