InfoHole A blog by Gordon Page

23Oct/0721

Firefox cache location

Firefox cache is the same thing as Internet Explorer's "temporary internet files", it keeps copies of webpages that you visit on your harddrive so that the page may load quicker the next time you visit it.

Even if you delete the cache each time firefox quits (tools, options, privacy tab) an expert may still be able to recover your cache data from your hard drive. You may wish to change the firefox cache location to an encrypted drive. Assuming you have setup your encrypted drive, or just want to change the location of the cache, simply do the following:

  1. type about:config into the firefox navigation bar and hit enter
  2. find the browser.cache.disk.parent_directory, if it doesn't exist right click anywhere and select NEW, then STRING.  Enter browser.cache.disk.parent_directory in the first popup box and then the location in the 2nd popup box e.g. k:\tempintfiles. If the entry already existed simply right click on it and select MODIFY and enter your new directory path.

Now your firefox cache location has been changed! This was tested on firefox version 2.0.0.8.

Firefox change cache location

Filed under: Computing Leave a comment
Comments (21) Trackbacks (1)
  1. For someone truely worried about this issue, a better solution is to set
    browser.cache.disk.enable
    to false which will prevent FireFox ever caching files on the hard drive in the first place. Mozilla has informationon this setting at:
    http://kb.mozillazine.org/Browser.cache.disk.enable#false

    One should be aware that either solution will not prevent information that FireFox (or any browser) stores in RAM from being swapped to the hard drive as part of virtual memory caching. (In Windows, this is the Windows Swap File.) The only way to deal with that is to have the swap encrypted, or encrypt the entire partition that the OS, applications, and swap file are running on. (There are a number of programs which will do this, such as BestCrypt, TrueCrypt, etc.)

  2. Great point Michael, thanks for posting.

  3. As a follow up please check out the following post which demonstrates recovering encryption keys from RAM: http://www.infohole.com/blog/computing/encryption-keys-cold-boot-attack

  4. works fine in Firefox 3 aswell.

    thanks!

  5. I was searching in about:config for cache and did not find any string which had a path.

    Working well.. Thanks..

  6. Glad to hear you got it working!

  7. okay,now how do i change the location of the offline cache in firefox 3?

  8. This is the offline cache location being discussed.

  9. In Firefox 3 there is no string or entry related to the cache *folder*.

    I mean there are several strings or entries related to the caché, BUT none of them let to change the location !

    Any input on Firefox 3 ?
    Thanks in Advance.

  10. Did you read step 2? If the variable doesn’t exist you can simply add it.

    “if it doesn’t exist right click anywhere and select NEW, then STRING. Enter browser.cache.disk.parent_directory in the first popup box and then the location in the 2nd popup box e.g. k:\tempintfiles.”

    I’ve tested this works in firefox 3 also.

  11. I fell so naive !

    Sorry for being so careless and a big THANKS to you !

    =)

  12. @admin
    Then why when I go to about:cache does it give a different location for “offline cache device”?

  13. @Robert
    What exactly is your question? The cache can be stored in any location.

  14. about:cache shows two locations:
    1) Disk cache device
    2) Offline cache device

    Each of these has a “Cache Directory”, and only the first is adjusted with:

    user_pref(“browser.cache.disk.parent_directory”, “c:\\…”);

  15. I hacked it, the preference setting for the offline cache directory.

    The preference name (key) is:

    browser.cache.offline.parent_directory

    Note that this can be set to the same value as browser.cache.disk.parent_directory. Since both of these settings are parent directories, they each create a sub direct: one named “Cache” and the other named “OfflineCache”.

    The insight for the hacked/guessed preference name was from http://www.dagorret.net/2009/06/12/great-firefox-tweaks/, which describes the setting for the offline cache size.

    Also, in searching for this, I found some discussion about an offline cache manager, but I could not find any description on how to use it. And, I found some suggestion that this feature may have been created to go along with Google Apps, but who knows.

  16. Sorry. How do I change the location of browser.cache.offline? I’ve looked at the above posts and all I see is how to set/change the location of browser.cache.disk.parent_directory

  17. @admin
    Sorry. How do I change the location of browser.cache.offline? I’ve looked at the above posts and all I see is how to set/change the location of browser.cache.disk.parent_directory.

    (don’t mean to double-post, I just realized that the first time I didn’t hit “reply”)

  18. Just an FYI to everyone with a 900a running Xandros Linux (and I assume anyone with a eeepc on Xandros). All steps are the same, but the string value needs to read with a “/home/user/” in front of the location. i.e. /home/user/d:/firefoxcache/. Also forward slashes are not a typo, it will not work with back slashes.

  19. @Michael Burns
    You can keep it from swapping it if you have your page file disabled. True this may not be reccomended for most users but if you have the maximum RAM Windows can use (about 4 gigs) then you can safely disable it if you monitor your RAM usage and it never gets anywhere full. Only might run into problems with Photoshop like stuff and some games, but you can simply re-enable it if you don’t use it much.

  20. Looks like the simplest secure way is to use minimal linux distro in RAM, like Slitaz linux 30Mb, and use web applications to store your large files. as long as you have enough RAM
    You can take out the hard disk to make your machine quieter if you want.
    Nobody gets your data but don’t leave your web passwords stored in the boot CD !

  21. hi all

    i am a beginner of linux and trying to figure out ways to view and extract files from cache of firefox in linux. i have no clue about what and how to do that. will be glad if helped.

    cheers,


Leave a comment