Thursday, August 14, 2008

Firefox 3 - Caching ISSUE

in Firefox 3 there is a weird bug which it somehow cache the page for no reason.
It just does not request to the server anymore... -(only if you update your updatepanel.

I have try many thing to avoid this.
1. Put meta tag which FF3 will ignore this -(
meta equiv="expires" content="Mon, 01 Jan 1990 00:00:00 GMT"
meta equiv="Cache-control" content="no-cache"
meta equiv="Cache-control" content="no-store"
meta equiv="Cache-control" content="must-revalidate"
meta equiv="pragma" content="no-cache"

2.Add Response Header - FF3 read this and by using Firebug, I notice that this info has been added to header
but it only worked in the first time, but after a while, it starts caching again.

Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches) ;
Response.Expires = 0;

Desperately I find doggy solution to handle this.
1. I notice that if the query string is change, FF3 will not cache. so it still go back to the server.
just add ur querystring with DateTime.Now.TimeSpan.Tick at the back, and FF3 will not cache anymore.

2. go to about:config and disable browser.cache.disk.enable and browser.cache.memory.enable. But this is very doggy solution, you can't force all of user to disable there settings which is not default from FF3. - (So just ignore this solution)

More reference about this bug.

Any other suggestion are welcome.