Caching in Firefox 3

published on
June 27th, 2008
by ego

@tadej told me a few days ago at the Firefox 3 launch party that he had issues with the way caching is handled in Firefox 3. I didn’t have such issues myself but it reminded me that I didn’t change the caching behavior when I installed it. So yesterday I opened the preferences and found the caching options under Advanced / Network. I was not really surprised that the options for how the cache works were missing — you really don’t want your everyday Joe to change this stuff since it may affect the perceived speed of the browser.

Since this was probably just left out of the interface I opened about:config and filtered with cache which gave me a few entries. The most interesting one was browser.cache.check_doc_frequency. Unfortunately it has a numeric value with a hidden meaning. And I had no idea what that meaning is.

I googled the thing and found a mozillaZine article about it. It explains how it works — the property defines how often the browser checks for a new version of a specific file. The possible values are as follows:

0
once per session
1
everytime
2
never
3
when out of date (default)

The default is 3 which is not very good for development purposes when you want changes to take effect immediately. What you want is 1 which means that every request will go to the server every time. You’ll get many 304s but you’ll also get a 200 as soon as a file changes on the server. So I changed the value to 1 and now I’m a happy developer.

Zemanta Pixie

Opinions

  1. posted on
    June 27th, 2008
    by fjodor

    oh, great, im not alone noticing this… i am wondering do my visitors see my changes immediately or is there any meta tag i should use to force refresh for them… i cant expect them to tweak the browser :/

  2. posted on
    June 27th, 2008
    by fjodor

    btw: i already am using

    but it does not seem to work in FF3 properly.

  3. posted on
    July 30th, 2008
    by ago

    Found your blog. FF3 caching bothers me too. Although changing this value didn’t change anything. It still is caching. Currently have to use IE for development :(

  4. posted on
    August 1st, 2008
    by Adam Morse

    Yeah, this was killing me…I kept thinking my CSS was bad…I would use safari, or a myriad of other browsers before I switched exclusively to IE for development purposes. But…using firefox 2 is also still an option if you use a profile manager.

  5. posted on
    August 3rd, 2008
    by Tom

    Thank you for this tip! I was going crazy, thinking FF was refusing to load changes from my local machine, which never happened before.

    Does anyone know what the expire date gets set to if neither the server nor the http-equiv meta tags specify it? Seems weird that FF would opt not to retrieve the page if it didn’t know an explicit expire date.

    And Adam, I’ve found it’s a bad idea to use IE as your dev environment–FF, Opera, Safari usually agree quite closely on positioning issues, and IE is the odd man out. Developing for compliant browsers and “tweaking” IE into place keeps me much more sane than the other way around. Just my $0.02.

  6. posted on
    August 4th, 2008
    by ben

    +1 to everything that tom said about developing in ie, and also don’t forget firebug. i couldn’t develop with out.

    but regarding the actual topic, i too was getting very frustrated by development in firefox 3 and had fallen back to just manually clearing the cache every time i made a change — a very annoying process.

    thanks for the fix, now i’m a happy developer too

    i wish the ff3 release notes had made a specific note of this

  7. posted on
    August 5th, 2008
    by Fabrice

    Thank you ! It drove me nuts !

  8. posted on
    August 19th, 2008
    by Brijesh

    I have done this and still it does not seem to resolve the caching issue in Firefox 3.
    Has anyone tried something else too ?

  9. posted on
    August 19th, 2008
    by ego

    What you can try is setting browser.cache.memory.enable and browser.cache.disk.enable to false which is what Web Developer Toolbar does when you disable cache.

    There’s also a setting called network.http.use-cache which is a boolean but I have no idea what it actually does - it might be that it only allows the use of caching headers on HTTP.

  10. posted on
    October 1st, 2008
    by jesse

    I set this value to 1 and it is still caching certain pages. Super…

  11. posted on
    October 20th, 2008
    by Sharron

    I my gosh I don’t have to do myself in! This was driving me absolutely bonkers.

    Ya can’t develop with this issue, I got rid of 3 and went back to version 2.

Express your opinion

My name is Marko Mrdjenovič and I’m a web developer and a manager from Ljubljana, Slovenia (N 46° 03.246,W 14° 30.265).

I work at Parsek Zemanta, I’m a WaSP ILG member and I’m also the program lead at local weekly talks Spletne urice.

Blog archive

Advertisments

Jobs

Come in, we're hiring

Full-time and freelance job opportunities available at Authentic Jobs:

  • Loading ...

Post a job and reach web professionals everywhere.