Pages

Subscribe:

Ads 468x60px

Friday, October 22, 2010

How To Change Google Chrome’s Cache Location And Size

Did you know that there is no setting in the graphical user interface of the Google Chrome browser to change the location and size of the cache? I searched up and down and could not find an option to do that. Some users may say that this is not essential anymore, with growing hard drives and such. Others may have a different opinion on it on the other hand, considering that Chrome always installs itself on the main system partition in Windows.

The cache is conveniently placed in the installation directory as well. You find the default Chrome cache location under C:\Users\username\AppData\Local\Google\Chrome\User Data\Default\Cache if you are running Windows 7.

Reasons to change the location and size of the Chrome cache.
  1.  Solid State Drives and system partitions with low storage space come to mind. 
  2. And some users may want to move the cache location to the RAM instead, to speed up things, get the cache auto deleted on exit or avoid to many write cycles on the system partition.


The only official option to relocate the cache and change its size are two command line switches that need to be added to the Chrome shortcut. That’s not the most elegant solution, considering that these shortcuts are not executed if Chrome is the default browser and a web address is launched from a third party software.
  • --disk-cache-dir
  • --disk-cache-size
The disk cache dir parameter defines a new location of the Chrome cache, while disk cache size changes the cache limit.
 Here is an example:
--disk-cache-dir=”d:\cache” --disk-cache-size=104857600
This changes the location of the Google Chrome cache to d:\cache, and the limit of the cache to 100 Megabytes.

How to do change the Chrome shortcut then to apply those new cache directions?
Step 1:In Windows, you locate the Chrome shortcut (on the desktop, start menu or taskbar), right-click it     and select properties. The shortcut tab should open in a new window. Locate the Target field in the tab and   append the cache directions to the end of the field, e.g.
C:\Users\username\AppData\Local\Google\Chrome\Application\chrome.exe --disk-cache-dir=”d:\cache” --disk-cache-size=104857600
Some users may want to limit the cache even further, to an absolute minimum. Those users can set the disk cache size parameter to 1, which works best for all cases.

Step 2: Ensure that Chrome is using the right cache location and size when a link is clicked (this is only necessary if Chrome is the default system browser). Windows users need to open the Windows Registry and do some Registry hacking for this. Open the Registry with Windows-R, typing regedit and the enter key.

Now locate the Registry key
HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command
You should find a path to the Chrome executable there. All we need to do is to append the cache location and size to the path so that Chrome uses the right caching information when links are clicked and Chrome is not open at that time.
Simply add --disk-cache-dir=”d:\cache” --disk-cache-size=104857600 after chrome.exe”, so that it looks like the following now:
“C:\Users\Martin\AppData\Local\Google\Chrome\Application\chrome.exe” --disk-cache-dir=”d:\cache” --disk-cache-size=104857600 -- “%1″
chrome cache location size

No comments:

Post a Comment