An analysis of local caches that Firefox uses
Back in the early days of the Internet, there was just a single cache for HTML files and static elements such as images but with the rise of HTML5 and modern web applications came new cache formats that modern web browsers use.
While it may make sense to use different locations for the cache from a developer point of view, it makes things difficult for privacy-conscious and technology-interested users who want to keep an eye on cache content and size.
Please check out our guide on clearing the main browser cache as it lists the main Firefox cache directory on the local system among other things.
This guide looks at new cache locations exclusively.
Firefox Cache Information
The Offline cache
- Windows Vista and newer: C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<salt>.<profile name>\OfflineCache
- Mac/Linux: /Users/<username>/Library/Caches/Firefox/Profiles/<salt>.<profile name>/OfflineCache
- Preference: browser.cache.offline.enable
- Values: True (enabled) or False (disabled)
- Additional information: https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Storage_location_and_clearing_the_offline_cache
Introduced in 2007, it has been designed to store elements tagged with rel="offline-resource" in the offline cache.
The main idea is to provide offline browsing capabilities to devices, to improve the performance of important resources, and to reduce server load. The offline cache can be used by HTML5 applications
Developers can use the Application Cache (AppCache) interface to specify resources that the browser should cache and make available to offline users. Applications that are cached load and work correctly even if users click the refresh button when they are offline.
IndexedDB
- Windows Vista and newer: C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<salt>.<profile name>\indexedDB
- Mac/Linux: /Users/<username>/Library/Caches/Firefox/Profiles/<salt>.<profile name>/indexedDB
- Preference: dom.indexedDB.enabled
- Values: True (enabled) or False (disabled)
- Additional information: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
IndexedDB is a browser technology that can hold large amounts of structured data and supports high-performance searches using indexes. It is available offline, online and from within HTML5 Web Workers.
IndexedDB is a transactional database system, like a SQL-based RDBMS; however whereas the latter uses tables with fixed columns, IndexedDB is a JavaScript-based object-oriented database. IndexedDB lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored
To view IndexedDB content, use an add-on like SQLite Manager for Firefox.
Dom Storage
- Windows Vista and newer: C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<salt>.<profile name>\webappsstore.sqlite
- Mac/Linux: /Users/<username>/Library/Caches/Firefox/Profiles/<salt>.<profile name>/webappsstore.sqlite
- Preference: dom.storage.enabled
- Values: True (enabled) or False (disabled)
- Additional information: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
This enables client-side session and persistent storage in Firefox. It is used to store (more) data on the local system compared to cookies. Dom Storage is used by supercookies but also by sites who need to save data on the local system.
Firefox users may use the FireStorage extension for the web browser to display the content of HTML5 Local Storage for the active site in the browser.
While it is possible to disable one, some or all of the listed caches, you may run into issues when using web applications that utilize the features.
Now You: Got anything to add or comment on? Let us know below in the comment section.
Setting “dom.storage.enabled” to false breaks PostNL parcel tracking site.
Such is life…..
There’s an “Indexeddb+++fx-devtools” entry in storage/permanent folder on both Waterfox Classic and the latest version of Firefox. Is that the same thing?
( had to revert to the default setting in about:config for “dom.indexedDB.enabled” since it causes an InvalidState error on my webmail (Tutanota) if disabled.
You omitted plugins’ cache files & folders.
Are all the infos contained in these caches not removed by CCleaner “improved by CCEnhancer” (at least mostly)?
I see the options “Firefox HTML storage” and “webappsstore.sqlite” and with a right click, you can analyze these caches and clean them.
It’s possible to view and manipulate the contents of local storage via the developer tools. In web console type localStorage;
Better, add the storage option via the developer tools settings. This provides access to dom, indexed db, session, cookies etc.
I’m running Firefox 42.0 on a Macbook and I see three files in the DOM cache while FF is running.
webappsstore.sqlite
webappsstore.sqlite-shm
webappsstore.sqlite-wal
The last two files are deleted automatically when FF closes. Webappsstore.sqlite is persistent. If you have a app like Find Any File that can find hidden files on a Mac, webappsstore.sqlite can be trashed normally after FF is closed.
FF is acting strangely. If I’m offline when I start FF and I “quit,” FF just hangs. I either have to force it to quit or, if it is left to itself, it crashes and I get a lovely message from the Mozilla Crash Reporter. (I’ve submitted a report)
Is there some way to say “load cached version of page in offline mode”? Maybe an add-on?
Also check
c:\Users\\AppData\Roaming\Mozilla\Firefox\Profiles\.\storage\temporary
in which for example facebook’s messages part stores what seems to be some asmjs byte-code thing, that not even restart (with enabled clear all at exit settings) purges (though can be deleted manually).
Edit time passed… the path correctly:
c:\Users\(username)\AppData\Roaming\Mozilla\Firefox\Profiles\(salt).(profile name)\storage\temporary
The user’s profile storage folder’s content depends of dom.indexedDB.enabled, true or false
“If set as false (disabled), this WILL break some [old] add-ons and DOES break some sites’ functionality” (Source and thanks to Pants).
Can be automatically wiped at Firefox exit by setting privacy.clearOnShutdown.offlineApps to true in about:config
Thank you Martin very useful!
Here with Firefox I’ve never encountered any issue by setting browser.cache.offline.enable to false
Concerning dom.indexedDB.enabled, set to true here, I understand it applies to websites, add-ons and session data and is maintained in user’s profile ‘storage’ folder, but I have no indexedDB folder nor file. “If set as false (disabled), this WILL break some [old] add-ons and DOES break some sites’ functionality” (Source and thanks to Pants).
dom.storage.enabled is required on some sites (even when they set no data!). A great add-on for dealing with Firefox’s Dom Storage (all in the webappsstore.sqlite file) is called ‘Self-Destructing Cookies’ since it handles Firefox’s Dom Storage as well as cookies (not to mention disk&ram cache as an option), emptying the storage and erasing cookies for sites not labelled as an exception by the user. The ultimate tool IMO for managing cookies as well as the Dom Storage on Firefox.
Thanks Martin, this article clarifies the caches used by Firefox. I’d focus on Dom Storage as a major privacy concern. If you set it to disabled you may encounter issues on some sites, otherwise, and without the add-on I mention, at least delete the webappsstore.sqlite file once in a while, on every Firefox exit is better. The file is automatically rebuilt.