View and Restore Firefox Cache Temp Files
In this article
To view and restore Firefox cache temp files, you need to locate the cache folder on your hard drive, where Firefox stores copies of web pages, images, and other resources to speed up loading. Restoring a file means copying it out of that folder before it gets overwritten or cleared — the browser itself doesn't offer a "restore" button for individual cache items.
What the Firefox Cache Actually Is
When you visit a website, Firefox downloads the page's HTML, CSS, JavaScript, images, and fonts. Rather than fetching every element from the server on each visit, the browser stores these resources in a cache — a temporary storage area on your disk. The next time you open the same page, Firefox checks the cache first, and if the file is still valid, it loads it locally. This makes repeat visits much faster and reduces bandwidth usage.
The cache is not a single file; it's a collection of files and index records. Firefox splits the cache into separate folders for different types of data, and the exact location depends on your operating system and Firefox version. Modern Firefox (version 68 and later) uses a "cache2" directory structure, with subfolders named after hash values — you won't see friendly filenames like logo.png inside. Instead, files are stored without extensions, and a separate index maps URLs to those files.
Where Firefox Stores Cache Files
Firefox stores cache files in a profile-specific folder. To find your profile folder, type about:support in the address bar and look for the "Profile Folder" row — it shows the full path. The cache itself is in a subfolder called cache2 inside that profile directory.
Typical locations by operating system:
- Windows:
C:\Users\<YourUsername>\AppData\Local\Mozilla\Firefox\Profiles\<randomstring>.default-release\cache2 - macOS:
/Users/<YourUsername>/Library/Caches/Firefox/Profiles/<randomstring>.default-release/cache2 - Linux:
/home/<YourUsername>/.cache/mozilla/firefox/<randomstring>.default-release/cache2
Note that the AppData folder on Windows is hidden by default — you may need to enable "Show hidden files" in File Explorer to see it. The profile name ending in .default-release is the standard profile for current Firefox releases; older profiles might be named .default.
How to View Cache Files
To view what's actually inside the cache, you have two main options: use Firefox's built-in debugging tool, or browse the cache folder directly with your file manager.
- Using about:cache: Type
about:cachein the Firefox address bar. This page lists all cache storage types (memory, disk, and perhaps others). Click on "List Cache Entries" next to the disk cache to see a list of cached URLs. Each entry shows the URL, the file size, and the last modified date. However, it doesn't show the file's location on disk. - Browsing the cache folder: Open the
cache2folder in your file manager. You'll see subfolders namedentriesand possiblydoomed. Insideentriesare the actual cached files, but they have names like3F2A9C1B0D4E5F6A7B8C9D0E1F2A3B4C— no extensions. You can't easily tell which file corresponds to which URL by just looking at the filename.
For a more user-friendly view, you can use third-party cache viewers (like Mozilla's own CacheViewer extension, though it's not officially maintained) or use the Network Monitor in Firefox's Developer Tools. Open DevTools (F12), go to the Network tab, reload the page, and you'll see each resource with its size and source ("memory cache" or "disk cache"). That tells you what's cached, but not where the file is on disk.
How to Restore a Cache File
Restoring a cache file means recovering a specific resource (like an image or a PDF) that you know was cached but is no longer available online, or that you want to extract for offline use. Since cache files don't have extensions and are named by hash, you need to identify the correct file first.
Here's a practical method:
- Open
about:cacheand find the URL of the resource you want. Note its size and last modified time. - Close Firefox completely (this prevents the cache from being modified while you copy files).
- Go to the
cache2/entriesfolder and sort files by size and date. Look for a file that matches the size and date you noted. - Copy that file to a safe location, then add the correct extension manually (e.g.,
.png,.jpg,.pdf) based on the URL's file type.
If the file is a text-based resource (HTML, CSS, JS), you can open it in a text editor after adding the right extension. For images, you might need to use a hex editor or an image viewer that can detect the format from content. Most modern image viewers can open files without extensions if you rename them with the correct extension.
A more automated approach is to use a cache viewer tool that reads the index and extracts files with proper names and extensions. Some third-party tools exist, but they may be outdated. Alternatively, you can use the Network Monitor in DevTools: right-click a request, choose "Copy" > "Copy response" (for text) or "Save all as HAR" (for a package). That doesn't restore the cache file itself but gives you the content.
Why You Might Want to Restore Cache Files
Common reasons include:
- Recovering a deleted or changed file: If a website updated an image or PDF, the old version might still be in your cache.
- Offline access: You want to view a page or resource without an internet connection.
- Forensic or debugging: You need to inspect exactly what was delivered by the server.
- Bypassing a paywall or login: Some sites restrict content after a certain number of views, but the cached version might still be accessible. (Note: this may violate terms of service; use at your own discretion.)
However, cache files are not guaranteed to be complete or valid. Firefox may evict entries to make room for new ones, and files can be corrupted. The cache is designed for performance, not for long-term storage.
Common Problems and Misconceptions
Misconception: Clearing the cache deletes your browsing history. That's false. History is stored separately in the places.sqlite database. Clearing the cache only removes temporary files.
Problem: I can't find the cache folder. Make sure you're looking in the correct profile. If you have multiple profiles, each has its own cache. Also, Firefox may store some cache in memory only, especially for small resources.
Problem: The file I copied doesn't open. You likely guessed the wrong extension. Try opening it with a file type detector or a hex editor to see the magic bytes (e.g., FF D8 for JPEG, 89 50 4E 47 for PNG).
Problem: The cache is empty even though I've visited sites. Firefox may have cleared it automatically (e.g., on exit if you set that in privacy settings), or you may be looking at the wrong profile.
Misconception: You can restore a cache file to recover a deleted website. The cache only contains resources you actually loaded. If you never visited the site, it won't be there. Also, dynamic content (like API responses) may be cached but with a short expiry.
Safety and Privacy Considerations
Cache files can contain sensitive data — login tokens, personal information, or content from private browsing sessions (though private browsing doesn't use disk cache in most cases). If you're restoring files, be aware that you're handling potentially sensitive data. When you're done, consider clearing the cache to avoid leaving personal data on your disk.
Also, never modify or delete files inside the cache2 folder while Firefox is running — it can cause errors or data corruption. Always close Firefox first.
If you're trying to recover a file that was accidentally deleted from your system, the cache is a long shot. Better to check your Recycle Bin or use file recovery software. The cache is not a backup system.
Frequently Asked Questions
Q: How do I clear the Firefox cache? Go to Settings > Privacy & Security > Cookies and Site Data > Clear Data, and check "Cached Web Content." Or use the shortcut Ctrl+Shift+Delete (Cmd+Shift+Delete on Mac) and select "Cache."
Q: Can I view cached pages offline? Yes, if the page is fully cached and you have the cache files, you can open the HTML file in a browser. However, many pages require network requests for scripts or data, so they may not work completely offline.
Q: Does Firefox cache videos? Yes, videos are cached like other resources, but they are often large and may be evicted quickly. You can find them in the cache folder, but identifying the right file is harder because video files are often split into chunks.
Q: What is the difference between memory cache and disk cache? Memory cache stores resources in RAM for the current session, which is faster but cleared when you close Firefox. Disk cache stores on your hard drive and persists across sessions. Both are used together.
Q: Can I set the cache size? Firefox manages cache size automatically, but you can override it by going to about:config and changing browser.cache.disk.capacity (in KB). Setting it to 0 disables disk cache.
Q: Is it safe to delete files from the cache folder manually? It's safe if Firefox is closed, but it's better to use the built-in clear cache function to avoid leaving orphaned index entries. Manual deletion may cause Firefox to rebuild the cache, which is fine but can be slower.