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.SetAllowResponseInBrowserHistory(false);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
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.
https://bugzilla.mozilla.org/show_bug.cgi?id=441751

https://bugzilla.mozilla.org/show_bug.cgi?id=327790#c8

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.aspnet.caching&tid=6d5121f2-d78c-4e26-9d58-bbce507842b6&cat=en_US_f2b00e34-9211-4139-87be-4b28e2f0ef79&lang=en&cr=US&sloc=&p=1

http://www.alittlemadness.com/2008/07/30/ajax-vs-caching-vs-firefox-3/

http://www.killersites.com/mvnforum/mvnforum/viewthread?thread=11626

=====
Any other suggestion are welcome.