Firefox caches web content to speed up repeat visits. Here's how the cache works, how to manage it, and when clearing it actually helps.
What's in the Firefox Cache
Firefox maintains several types of stored data:
| Type | What it stores | Location |
|---|---|---|
| Network Cache | HTTP responses (HTML, CSS, JS, images) | Disk + RAM |
| Image Cache | Decoded images | RAM only |
| Offline Storage | Service worker caches | Disk |
| Session Storage | Temporary tab data | RAM |
| LocalStorage / IndexedDB | Site-stored data | Disk |
| Cookies | Authentication, preferences | Disk |
The "Cache" you clear in Firefox settings refers primarily to the network/disk cache.
How the Network Cache Works
When you load a page, Firefox checks:
- Is this resource in the cache?
- Is it still valid (based on HTTP headers:
Expires,Cache-Control,ETag,Last-Modified)? - If valid: serve from cache (fast)
- If stale: send conditional request to server to revalidate
Cache-Control: max-age=3600 means Firefox won't re-fetch the resource for 1 hour.
Cache-Control: no-store means Firefox never caches this resource.
For sites that version their assets (e.g., main.a1b2c3.js), the cache is effectively permanent — each new deploy gets a new URL, so old cache entries become orphans.
Cache Size and Location
Default cache size: Firefox auto-manages cache size based on available disk space. You can set a custom limit.
about:config:
-
browser.cache.disk.capacity— Maximum disk cache in KB (default: auto) -
browser.cache.disk.enable— Toggle disk cache on/off -
browser.cache.memory.capacity— RAM cache in KB (default: auto, based on available RAM)
Cache location:
- Linux:
~/.cache/mozilla/firefox/[profile]/cache2/ - macOS:
~/Library/Caches/Firefox/Profiles/[profile]/cache2/ - Windows:
%LocalAppData%\Mozilla\Firefox\Profiles\[profile]\cache2\
This is just the disk cache. Image cache is in RAM and not accessible as files.
Clearing the Cache
Quick clear: Settings → Privacy & Security → Cookies and Site Data → Clear Data → check "Cached Web Content" → Clear.
From address bar: Type about:preferences#privacy → scroll to "Cookies and Site Data" section.
Keyboard shortcut: Ctrl+Shift+Delete → check "Cache" → select time range → Clear Now.
Just for a specific site: DevTools (F12) → Storage tab → right-click "Cache Storage" → Delete All (clears service worker caches for this site).
Or: address bar → lock icon → "Cookies and Site Data" → "Clear Cookies and Site Data" for just the current site.
Force Reload Without Cache
Hard reload: Ctrl+Shift+R (or Ctrl+F5 on Windows/Linux) — reloads the page and re-fetches all resources, ignoring cache.
In DevTools: Open DevTools, right-click the reload button → "Empty Cache and Hard Reload." This disables cache for all resources during the DevTools session (not just this reload).
Or: DevTools → Network tab → check "Disable cache" — cache is disabled while DevTools is open. Close DevTools to re-enable.
When Clearing Cache Actually Helps
When clearing helps:
- You updated your website and visitors see the old version
- A site stopped working after an update
- A site's layout is broken and you suspect stale CSS
- You're running out of disk space (the cache can grow to several GB)
When clearing doesn't help:
- The site is just slow (cache makes it faster, not slower)
- You have login/authentication issues (you want to clear cookies, not cache)
- JavaScript errors (usually code issues, not cache issues)
- Page content looks wrong (check if it's a cache issue by doing a hard reload first)
Cache Inspector in DevTools
DevTools → Storage tab → Cache Storage — shows service worker caches for the current site.
DevTools → Network tab → check "Disable Cache" + reload — shows the actual network timing without any cache benefit. Useful for testing load performance from scratch.
Cache Header Debugging
In DevTools → Network tab, click any cached resource → Headers tab → Response Headers:
-
Cache-Control: max-age=...— how long this resource is cached -
Age: N— seconds since this response was cached by an intermediate proxy -
X-Cache: HIT— this response came from a CDN cache, not the origin -
ETag: "..."— validator for conditional requests
For developers: "Disable cache while DevTools is open" is the most practical setting during development. For users: Ctrl+Shift+R (hard reload) is usually enough to fix cache-related issues without clearing your entire cache.
Top comments (0)