Closed Bug 525266 Opened 13 years ago Closed 12 years ago

Disk cache is deleted when browser restarts


(Firefox :: General, defect)

Not set





(Reporter: adam.m.s.martin, Unassigned)


(Whiteboard: [CLOSEME 2010-12-01])

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv: Gecko/2009101600 Firefox/3.0.15
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv: Gecko/2009101600 Firefox/3.0.15

I have enabled my Disk cache, and set it to a suitably huge amount (250MB), but it has no noticeable effect, because FF wipes it every time I restart the browser.

While the browser is running, it correctly uses the RAM cache - so far, so good.

But when the browser crashes, and I have to restart it, all my tabs (usually: several hundred different pages) are blank / fail to load, because FF has deleted its own disk cache, for no apparent reason.

This is a huge problem to a variety of use-cases (all of which have affected me at one time or another):
 1. anyone with a mobile internet connection - each re-fetch of a page is charged at dollars per megabyte, with high minimum charges.
 2. anyone with a non-permanent internet connection - e.g. laptop users; when FF crashes while you're on the move, you lose EVERYTHING, for no reason. You can restart the browser, but it's deleted all the data
 3. anyone with a particularly slow internet connection (e.g. in rural areas without broadband) - downloading a page can take several minutes. Re-downloading all the open pages "just because FF crashed" can easily take an hour.

I thought Mozilla used to have a working disk-cache that solved all the above use-cases - but it's been such a long time since I used Moz that I'm not at all sure?

Reproducible: Always

Steps to Reproduce:
1. Start browser, go to any cacheable site
2. Unplug internet
3. Close browser, select "yes" for "remember tabs on restart"
4. Restart browser
5. ...your web page is missing. Verify by going to about:cache - empty cache
Actual Results:  
about:cache reports an empty disk cache (and an empty RAM cache, which is expected)

Expected Results:  
Page should reload from cache when there's no internet connection, or allow Work Offline mode to work.

Setting Work Offline fails too - because FF has *already* deleted everything from the cache, so it cannot access anything in Offline mode.
Just to verify, in the preferences, Privacy tab, is "Clear History when Firefox closes" UNchecked?
Or, if checked, that the Settings subwindow doesn't have "Cache" checked for deletion?
Re: #1

Clear history is UNchecked

In the settings subwindow, Cache is CHECKED (although that shouldn't matter, given the above?)

However ... something very strange also happened.

I didn't change anything in that dialog, but new pages are now going into the disk cache and being persisted between restarts.

Please leave this bug as UNCONFIRMED for now, because it's no longer reproducible as it was just a few hours ago :(. I'll investigate further, and see if I can narrow down the conditions in which the bug occurs.

The infuriating thing is that just now is the first time it has ever worked as expected. Unless this is a bug that just got fixed in the latest 3.0.15, and I hadn't restarted since I upgraded (I'm 99% sure I had restarted at least twice since upgrading).

"But when the browser crashes, and I have to restart it"

This phrase seems to imply that you usually only restart Firefox after a crash.

I would make a distinction between:
 * Proper termination; in that case, cache data is persisted.
 * Crashes; in that case, cache data is deleted on startup.

Infuriating though it is in your described cases, I think it makes better sense to clear cache after a crash rather than reload data from that cache and risk crashing again because of it (it would be unsettling to a "typical" user to see his browser crash twice in a row without any explanation).

In that case, the behaviour you're describing would be intended rather than buggy. The only fix I can imagine for your described use cases would be to add a  "Clear cache after crash" parameter, set either as a boolean or a number of crashes to go before clearing cache.

Of course, everything I wrote here is based on the assumption that in all the (rare) cases where you close Firefox without crashing, you didn't think about the disk cache. I would suggest using an addon such as Cache status ( to monitor cache state.
the cache is deleted when the browser crashes - bug 105843 wants to change that
Reporter, please retest with Firefox 3.6.12 or later in a fresh profile ( Also update your plugins (flash, adobe reader, java, quicktime, silverlight, etc.) Go to the developer's website and download the latest version from there. If you no longer see this issue, please close this bug as RESOLVED, WORKSFORME. If you do see the bug, please post a comment.
Whiteboard: [CLOSEME 2010-12-01]
Closed: 12 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 105843
You need to log in before you can comment on or make changes to this bug.