Home > computing > Firefox cache location

Firefox cache location

October 23rd, 2007

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

gordonrp computing

  1. Michael Burns
    February 10th, 2008 at 15:41 | #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. gordonrp
    February 10th, 2008 at 17:42 | #2

    Great point Michael, thanks for posting.

  3. gordonrp
    February 25th, 2008 at 02:01 | #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. September 14th, 2008 at 22:57 | #4

    works fine in Firefox 3 aswell.

    thanks!

  5. September 15th, 2008 at 23:33 | #5

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

    Working well.. Thanks..

  6. admin
    September 16th, 2008 at 00:11 | #6

    Glad to hear you got it working!

  7. vann
    February 9th, 2009 at 07:04 | #7

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

  8. admin
    February 9th, 2009 at 07:14 | #8

    This is the offline cache location being discussed.

  9. mrburgos
    February 15th, 2009 at 00:30 | #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. admin
    February 15th, 2009 at 00:43 | #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. mrburgos
    February 15th, 2009 at 03:00 | #11

    I fell so naive !

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

    =)

  12. Robert
    June 11th, 2009 at 00:37 | #12

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

  13. admin
    June 11th, 2009 at 00:53 | #13

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

  14. TesserId
    June 17th, 2009 at 21:48 | #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. TesserId
    June 17th, 2009 at 22:24 | #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. Robert
    June 24th, 2009 at 02:04 | #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. Robert
    June 27th, 2009 at 05:23 | #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. Ryan
    July 11th, 2009 at 05:04 | #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. B
    July 25th, 2009 at 07:26 | #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.

  1. January 24th, 2010 at 08:25 | #1