Moving Web Browser Cache
Jump to navigation
Jump to search
Why
Trust me. Well:
- If you have faster storage (but in limited quantities) than your home folder, this can speed up web browsing
- If you are backing up your home folder and want to backup your browser profiles (including settings, bookmarks, add-ons, etc), you really probably don't want to backup your browser cache as well. Backing up your browser cache is silly and will take up a lot of space and time.
How
- Basically, you'll set a profile variable browser.cache.disk.parent_directory to the path on disk in which you want your cache stored.
- Then, you'll want to close Firefox
- Optionally, you can then move your browser cache from the old location:
~/.mozilla/firefox/<profilename>/cache2/
to the new path you specified. Otherwise, the next time you start Firefox, your cache will be empty (which may be a good thing if you want to start fresh). - Open Firefox and verify that it is writing to the new location
- Optionally: Clear any of the old data from your backups to free up space
More Info
If you run multiple Firefox browser profiles like I do, you'll need to make this variable change to each profile and give each of them separate paths (don't use the same path!). I use:
/scratch/jeremy/firefox/<profilename>/
My /scratch directory is located on a different zfs dataset (filesystem) that I use for any kind of variable data that I have no need to keep around. It is not backed up, but my profile settings (stored in ~/.mozilla/firefox/<profilename>/) will be.
See: http://kb.mozillazine.org/Browser.cache.disk.parent_directory for more details.