Firefox caching issue

Today I discovered an issue with Firefox. It was a rather annoying issue, since it made Firefox skip its cache and loaded already visited content.

While navigating with the web developer console open (press F12 while inside a page to open, it's a lifesaver tool and a must for all web developers), I noticed that while visiting a site that I visited a couple of minutes ago, I looked at many 200 HTTP status codes for images. "This is strange" is the first thing that came to mind. Pressing F5, it loads the images again, while it shouldn't.

First thing to do is disable one by one the few addons that I have (Lastpass, Flashblocker, FireGestures, and Speed Dial FVD). So, I disabled each one, restarted Firefox and visited the same site again and again, looking at the HTTP response codes returned by the web server. Nothing, the same behaviour. All images were loaded again.

Next action was to create a empty user profile and see what happens. I fired Firefox with the -profilemanager option, created a new profile and started the browser using this new profile. While in the new profile, the problem did not occur. After the first load of the page, the next load skips the images entirely. Pressing F5 to force checking, the web server responds with HTTP 304 status code (not modified), which is the expected behaviour. Going back to my usual profile, the problem still exists, images are fetched again and again.

Next thing to try is clearing the cache, all of it. When I clicked on Clear now at the Clear Recent History window, some disk activity is done, but after waiting several seconds, the browser is stuck using 100% of the cpu. Abnormal behaviour. I had to kill it. Started it again, tried to clear the cache again, same issue with frozen browser. Something is not quite right.

So, I decided to delete the profile and started from scratch. The browser works ok now.

The root of the issue is that Firefox did not send the If-Modified-Since and If-None-Match HTTP request headers. So the web server responded by sending the content again and again as it should. And this did not happen for images, but for all cache-able content (images, javascript, css, etc.).

This could be a bug hidden inside some lines of code. It could be some old add-ons that messed up the profile. The profile was created long time ago (I cannot remember which version I used then), so there's some possibility that going forward from version to version created some inconsistencies or problematic configuration, who knows.

My point is that if you experience unexpected behaviour with your browser, try to see if the problem persists after creating a new user profile. If it does, there's apparently a misconfiguration with your profile and it should be created from scratch. It will save you from a lot of headaches and debugging.

Χρήσιμο / Useful: 
No votes yet
Ψηφίστε για την ποιότητα του άρθρου / Vote for the article's quality