Moving Browser Cache Folder in IE, Firefox, Chrome, Opera, and Safari

Having recently replaced OS partition hard-drives with solid-state drives on my desktop and two laptops, I decided to tweak a few settings on my Windows in order to reduce the number of unnecessary write operations to SSD. Amongst the candidates for the move from more expensive SSD space to spinning hard-drives, I selected temporary Windows folder and browsers cache folders. Moving temporary Windows folder turned out to be one step operation – changing Environment variables in Computer – Advanced system settings dialog.

However, after this quick success moving my browsers cache away from SSD turned out to be not the most trivial task due to a large number of different browsers and their very different approach to storing configuration settings. Here is my experience and instructions on how to do it in various browsers.

Internet Explorer:

IE offers the easiest and most convenient way to change a new folder for cache.

Tools – Internet Options – under ‘Browsing History’ section choose ‘Settings’
Click ‘Move folder…’ and provide the new location, e.g. d:\Temp\IE

Heads up: After providing a new temp folder and clicking OK to save new settings, IE/Windows forcefully closes current user session, and logs the user off.

Firefox:

In the URL type: about:config
Create a new string preference: browser.cache.disk.parent_directory
and specify a path to your cache folder, e.g.: d:\Temp\Firefox

Mozilla Zine: Browser.cache.disk.parent directory

Chrome:

The only way to change location of the cache folder is through the command prompt arguments:
C:\…\Application\chrome.exe –disk-cache-dir=”d:\Temp\Chrome” –disk-cache-size=75000000

Where –disk-cache-dir points to your custom cache folder, and –disk-cache-size specifies the maximum cache size in bytes.

Here is a full list of Chrome’s command line switcheshttp://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc. Surprisingly, source code seems to be the only official documentation from Google. A brief blog post on the same topic: http://peter.sh/experiments/chromium-command-line-switches/.

Additionally, Chrome doesn’t expose that parameter in its configuration settings in a fashion similar to FireFox. If you navigate to about:flags in the Chrome, it provides some under the hood settings, but no cache configuration.

How to Turn On/ Disable GPU Hardware Acceleration on Google Chrome.

PS: Another useful command for Chrome, which reduces its memory footprint: –process-per-site. This command allows Chrome to run tabs from the same domain in the same process, thus reducing number of spun out processes and memory use, while still offering process isolation. http://www.chromium.org/developers/design-documents/process-models.

Opera:

Review the location of the current cache folder by typing in the URL: opera:about or from Menu – Help – About Opera.

To modify the settings type the URL: opera:config

Navigate to “User Prefs” tab and modify its cache folder: Cache Directory4 =d:\Temp\Opera\
(alternative quick jump link: opera:config#UserPrefs|CacheDirectory4)

Additionally you can modify temporary download folder for Opera as well, through another key:
Temporary Download Directory = d:\Temp\Opera

Opera’s Settings File Explained

Safari:

Safari unfortunately does not provide any way to change the location of its cache directory, just like it does not provide any way to change its advanced settings in a comprehensive way.

about URI scheme

Bookmark/FavoritesLinkedInFacebookTwitterGoogle BookmarksDiggDeliciousShare

5 Comments

  1. joeHope says:

    Nice to have this all in one place — thanks. FYI, looks like Chrome may have changed the switch, and your site has reformatted the dashes and quotes for that one. Try i.e. –user-data-dir=”D:\Temp\Chrome” now. (Starts with two dashes and quotes should be regular non-curly quotes.) Also maybe worth noting that the Save button for Opera is at the bottom of the expanded “User Prefs” group — not at the top or bottom of the page where you might think to look first.

  2. admin says:

    thanks for the great feedback, joeHope!

  3. WalterE says:

    Thanks! This is extremely helpful.

  4. Jason says:

    Interesting… but why not move all of the user folders off of the SSD to start with then the browser cache will be on the spindle drive. *note* you will want to change the local administrator profile location to the SSD in the case that the spindle fails.
    http://answers.microsoft.com/en-us/windows/forum/windows_7-files/win7-how-do-i-move-user-folder-to-a-different/565f16a5-e5ed-43c9-8422-4f56aebb296e

  5. Excellent and simple explanations. Thanks for the great post. I have found it very useful to move the temporary files to a RAM Disk, improving performance and saving SSD from lots of writing/reading cycles.

    Best,
    Diego

Leave a Reply