July 15th, 2009 at 10:08 pm

Firefox and the Cache Mystery

Jump to Comments
Submit to del.icio.us

Lately I’ve been working on a small and fast CMS system for my new website. I’m hoping the website will attract a lot of visitors and since my server is not that strong I’ve decided on sending some caching headers so the browsers won’t overwhelm the server with requests.

After some research the Cache-Control header will work the best for me. It sets an ‘freshness’ time to the resource and during this time the browser won’t request the resource again and simply load it from disk.

This might seem like a very easy case but it did give me some problems. After sending the headers I verified with firebug that the header was being sent, but when I refreshed the page, Firefox was requesting the resource again. I was stunned, here I was sending the right headers and somehow the browser was simply ignoring me… or was it?

After some asking around I was still getting nowhere, somehow Firefox just did not want to cache my resources. But after much searching around on the internet, I finally found my answer. Firefox does not load resources from the cache when refreshing!.

I don’t know why, but I guess it makes sense somehow. But I don’t know why they didn’t move this to the Hard-Refresh. (Ctrl+F5 or Ctrl+Shift+R). If anyone can answer me this, please do.

Leave a Reply