Search This Blog

Friday, August 06, 2010

Make Caching Less Aggressive in Firefox on Development Machines

I have been having some issues with Firefox caching files too aggressively on my development machine at work: not good when you write client-side code.

My first attempt to resolve the issue was to disable caching entirely using the Web Developer toolbar (Disable > Disable Cache). However, that is not optimal, as every page resource gets downloaded every time you refresh the page.

So I did some reading up, and, just as I suspected, there is a Firefox configuration setting that forces a 304 request each time you refresh the page. This solution is superior to disabling the cache, as only resources that have changed are downloaded again.

If you have caching problems (or you're concerned that you might), you'll need to change a value in Firefox's "power-user" configuration settings. Here's how:
  1. Open a new tab, type about:config into your address bar, and promise Firefox you'll be careful. ;)
  2. Enter browser.cache.check_doc_frequency into the filter field.
  3. Change the value from 3 to 1, which tells Firefox to check the server for updated resources on every refresh.
Further Information: For the full reference see here, and for a list of the seven hidden pages in Firefox, see The Seven "Hidden" Pages.

2 comments:

  1. BlueHost is ultimately the best web-hosting provider for any hosting plans you might need.

    ReplyDelete
  2. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me..I am a regular follower of your blog.
    Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from HTML5 CSS3 Javascript Online Training from India .
    or learn thru HTML5 CSS3 Javascript Online Training from India. Nowadays JavaScript has tons of job opportunities on various vertical industry. HTML5 CSS3 Javascript Online Training from India

    ReplyDelete