Why you may want to clear the Firefox cache from time to time
I recently noticed a big drop in available disk space on my computer's main hard drive. Since it is a Solid State Drive with only 128 Gigabytes of storage, I'm observant when the available storage drops below the 10% mark on the drive.
A drop in available space can come quicker than you think, for instance by using a tool to convert videos to DVD movies.
Since most programs use the C: drive as a temporary space for conversions, and also to place the finalized product on, it has happened in the past that a single conversion dropped storage space by nearly 10% as well.
This time though, things were not as easy to find out at first. I noticed that the space dropped below the 10 Gigabyte mark, which is problematic if you are running a SSD as it may have an impact on the drive's performance.
Whenever I want to analyze the disk space, I use a program like TreeSize Free to do so. While it is certainly possible to browse folders and files manually, it simply takes to much time to be effective.
I noticed a huge Mozilla Firefox profile directory after the scan. The directory used more than 9 Gigabytes of space.
Update: As some users pointed out, the large cache directory has been caused by an experimental feature that is only available in Firefox Nightly, and not in other versions of the web browser. It is still a good idea to check the size of the cache regularly to make sure that it does not overflow.
Further investigation revealed that the majority of space was used by the cache2 directory of the profile folder, indicating that it was temporary data that was taking up that much space on the system.
I decided to clear the browser cache using Firefox's own delete history menu. The use of the Ctlr-Shift-Del shortcut displayed the window, and I configured it to delete all cached files of the browser.
To my surprise, it only cleared about 1.3 Gigabytes of cached files in the profile folder, which meant that about 8 Gigabytes were still stored in the folder. Puzzling, to say the least.
I decided to look in the cache2 folder manually, and found only a couple of leftover files in there. This meant that the cache had been cleaned successfully, and that TreeSize Free had not updated its display properly.
I restarted the application and it too did display the correct cache amount afterwards.
Almost 9 Gigabytes of cached files is a lot. I'm not entirely sure why Firefox accumulated that much storage space in first place.
I made the decision to configure the browser to clear the history automatically on exit, to make sure that I would not run into the issue again at a later point in time.
You can do so in the following way:
- Tap on the Alt-key on your keyboard to bring up the menu bar.
- Select Tools > Options from the menu.
- Switch to the privacy tab here and select "Use custom settings for history" under History.
- Check the "Clear history when Firefox closes" box and click on Settings afterwards.
- Check "cache" at the very least and click ok.
- Note, if you select cookies, your signed in sessions on websites and services are removed, which means that you will have to sign in again the next time you use them.
- If you select Browsing & Download History, Session Restore won't work. This means that the tabs from last session won't be opened and that you cannot restore them either.
Now Read: Try these fixes if Firefox is slowAdvertisement