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.
There are several reasons why someone would want to change the location and size of the Chrome cache. Solid State Drives and system partitions with low storage space come to mind. 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.
Changing Chrome's Cache size and location
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?
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.
Now another step is required to 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"
There is an alternative to adding the location command line parameter to Chrome. Symbolic links can be used to move cache location from its original path to another one.
Policies
Instead of using parameters to set the cache location and size of the Chrome web browser, system administrators can also use policies to do so. This is how it is done in Windows:
- Open the Windows Registry by tapping on Windows-R, typing regedit and hitting the enter key.
- Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium
- Add the Dword DiskCacheSize with a right-click on Chromium and the selection of new > Dword (32-bit value) from the context menu.
- Give it a value in bytes.
- The cache directory can be set when you create the String value DiskCacheDir and change its value to the new location on your drive.
You can check out How To Move Large Apps Or Games To Another Drive if you want to create the junction manually. We recommend to use a program like Steam Mover to do that, as it offers to make the change without having to use the command line.
The Chrome developers should consider adding options to the graphical user interface to change the location and size of the cache.
Advertisement
idk why, but i used Policy way with Creating Google\Chrome in policies folder (there was only ms one by default)
i added cachedir cachesize downloaddirectory, and both thing with folder placement work totally fine, but cachesize – i set it to 104857600 in decimal (it show it as 6400000 Hexadecimal)
and cache already over 100mb (which must be 100 if that number was bytes)
so is it bytes or mb ??
ps. can just make .reg file with (obv you insert path you would be using)
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
“DiskCacheSize”=dword:06400000
“DiskCacheDir”=”D:\\Chrome\\Cache”
“DownloadDirectory”=”D:\\Chrome\\Temp”
Policy – the registry path for Chrome should be
HKLM\Software\Policies\Google\Chrome\DiskCacheDir
instead of
HKLM\Software\Policies\Chromium\DiskCacheDir
after this change in registry everything works fine for me ;)
There are a few issues with this article.”And some users may want to move the cache location to the RAM instead” and yet the author doesnt mention how to move it to the RAM.
And “get the cache auto deleted on exit or avoid to many write cycles on the system partition.” and doesnt mention HOW to get the cache auto deleted on exit.
I have already finished with the steps above. However, when I try to update some of my programs and open the update link, instead of the program update web site, the programs open “disk-cache-dir%3Df/temporary internet files” location. This is something I have not seen before and I am baffled by it. How do I change this behavior? Steve
Hi,
Thank you for this trick.
As you mention that some people don’t want the cache in the system, there is a golden rule: don’t mix OS, applications and data. Otherwise you can’t backup and restore selectively. You don’t want a 1 or 2 TB backup when you save your working OS or your work (since Vista, only a disk image can save the system so a separate partition is necessary). You don’t want to wipe one week or one month of work when you restore a system damaged by a bad update, a virus or whatever. People who work with their computer want to save their data every day and this backup must not weight 1TB. This lack of separation, introduced by Windows, is probably the reason why so many people don’t backup their computer regularly and millions of hours of work are lost, photos etc.
As already described, I find it easier to manually move the cache folder and then make a link:
use a DOS window
go to the folder where google puts the cache by default : cd …
mklink /D Cache Path
where Path is the path where you moved the cache folder.
I’ve used it for years without problem.
Please note that this is different than making a shortcut as in this case, the link is in the operating system. The program doesn’t see a link, it is just led to the new directory by the OS as if it were no link.
yay! thank you!!! problem solved.
Not working on Ubuntu/Elementary OS :(
Tried this command but cache folder exceed this limit
/usr/bin/google-chrome-stable –disk-cache-size=524288000
FYI:
Elementary OS 0.3.2 x64
Chrome Stable 47.0.2526.106 x64
I can confirm that the solution with the simlinks works beautifully :)
I also recommend using simlinks to “reroute” the Media Cache as well.
Better yet, the entire “User Data” folder.
– close chrome
– move (not copy!) the entire “…\AppData\Local\Google\Chrome\User Data” folder to a new location (in this case I’ll move it to “D:\Chrome”)
– open a command prompt with admin privileges
– then type this
mklink /d “C:\Users\User Name\AppData\Local\Google\Chrome\User Data” “D:\Chrome\User Data”
The next time you open chrome, it should load your stuff from the new location, and it should also write all cached data to the new location as well.
Or, for anyone not wanting to drop to the command-line:
http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html
This article is out off date. Please update this!
Working just fine for me, along various Chrome versions.
Using Chrome 46 64-bit now, was 37, 38/etc, probably older too. :)
Using a Windows 10 64-bit, Pro OS upgraded from 8.1, which was preceded on same PC by Windows 7, no issues whatsoever.
What part of it is outdated?
The ultimate in limiting the cache:
–disk-cache-dir=null
Hi guys please help i try to modify HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command.
when i did i restarted and it was ok. but then somehow –disk-cache-dir=”d:\cache” dissapered from there. i changed it once again, but now it doesnt work. when i press the link in skype it opens with default cache location on C:
Wow guys!!! very useful and understandable article. Thanks.
Isnt Google supposed to have the best programmers and ideas in the world ? No cache settings in the UI … sad. They’re only good at controlling information they need.
Quote “The Chrome developers should consider adding options to the graphical user interface to change the location and size of the cache.”
Oh, you mean adhere to long-established standards in the software community? Something that google started breaking six years ago with annoying frivolous changes to the gmail interface. Ignore long-time virtual-standards in the industry and ignore fixing the basics and instead annoy everyone with meaningless changes while breaking de-facto standards. Google has deviated from industry familiarity more than any other company on the planet.
I’m using Win 7 Home Premium, SP1 and Chrome version 33.0.1750.154 m
Your operating system does not ship with the Group Policy Editor, that’s the reason why this won’t work.
Same problem here. Using Windows 7 though, the registry tag HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium does not exist. Any ideas?
Which edition of Windows 7 are you running, and which version of Google Chrome?
On Windows 8.1, the registry tag HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium does not exist. Any idea where to find it?
Good information, thanks for posting.
BUT please, don’t post code from a WORD document. It has non-ASCII (and thus non-HTML) character substitutions! Where the two dashes were supposed to be was replaced by a long dash. And the simple standard quotes were replaced by left- and right- quotes respectively.
It would be a good idea to edit this webpage and fix these problems, because otherwise there are a lot of people like me who will simply cut-and-paste and then will get very strange errors when the browser is invoked.
trumpman, no – the quotes and double dashes are just fine.
The quotes were bad originally, but then the author fixed them.
Oh, sorry about that. I had several references up regarding changing the cache location – it probably was another page I cut and pasted from, eg. the one from The Tech Journal. I’ll also have to keep an eye out about WordPress modifying symbols as the author has noted.
this did not work for me, it said the name specified in the target field was not valid
Can you post your target field here?
I ended up in a mystery :) A RAM-disk is mounted with IMDisk, I changed pathes as I was told, and finally deleted what was in C:\Users\user\AppData\Local\Google\Chrome\User Data\Default\Cache. Chrome works fine and is faster now, but there is no cache. The RAM-disk remains empty, and so does the old …\Default\Cache. I checked is with the ChromeCacheView. It could find one.
So I guess a don’t have a cache anymore.
Can’t get it to work. My company is using VMware guest workstations with user profiles stored in the D: drive. I have tried setting the target to “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –disk-cache-dir=”D:\Users\usernamehere\AppData\Local\Google\Chrome\User Data\Default\Cache” –disk-cache-size=20971520
… but the cache still grows beyond the 20MB limit. Also tried copy/paste to then from notepad++ to fix any quotations issues but no luck.
What Host OS? What Guest OS?
What version of Google Chrome?
Works fine for me set as –disk-cache-size=304857600
which seems to be about 300 MBs.
Why would the Host OS matter? Completely transparent to the OS and browser.
Guest OS is Windows7 x64.
Chrome 28.0.1500.72 m.
Nevermind, I found the issue… the –disk-cache-size value is in MB, not bytes… so
–disk-cache-size=20
would give you a 20 MB cache, whereas
–disk-cache-size=20971520
would vie you a 20971520 MB cache.
All I can tell you is, since I set it to 20 the size of the Cache directory has never been anything other than 20.2 MB… take from that what you will…
Hm, are you sure about that? The value was bytes previously and Google noted on several occasions that it is not a hard limit and that Chrome may use more cache even if you have set the cache to a lower value.
According to this page, it is in bytes: http://dev.chromium.org/administrators/policy-list-3#DiskCacheSize
I see you edited it now! Thank you. :)
I finally looked it up. It is WordPress that is automatically modifying quotes. I write about how I have changed that soon.
I write about how I have changed that soon.
It was March – now it is almost August, please define “soon”? :)
Um, can you edit the blog post to have the correct quotation marks??
The quotes need to be straight quotes, NOT the slanted opening/closing quotes you listed.
Maybe if the proper quotation marks were listed, everybody could do this quite more easily. :)
Adding the switches to the Quick Launch and desktop shortcuts worked perfectly, so they’ll launch Crome with the cache on the ramdisk.
However, when Chrome is launched from the “mail” link in Yahoo Messenger, it is NOT using the ramdisk cache. In the registry, I have added the command line switches not just to the HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command key, but to all instances of the Chrome launch path (5 or 6 keys in all), and it is still not working. What am I missing?
What are the 5 or 6 keys that need to be modified? Please list them …
Just found the solution to my problem — I had copied and pasted the switches from the browser, which used the wrong double-quote character. After hand-inserting the double-quotes in the registry editor, it all started working. This was already mentioned in a previous comment, I just wasn’t paying attention. :(
Great that you sorted it out.
Drastic (?) step to direct Chrome cache to a non-existent drive — Q is used.
Can’t find any chrome cache files but there has to be a reaction somewhere? Error log?
I can’t locate anything. Chrome and the computer work just fine.
it works, now I just need to figure out if I want to keep my previous cache on C disk, I assume if deleted, some of the information may be lost in chrome, which I want to keep. What if I just move cache from C disk to the new location will it be able to recognize it?
Alternatively just add the correct values in the registry. Either via group Policy (can be applied locally, too) or by manually hacking it in. Under HKLM it works for all users on the system, HKCU should work only for the current user.
See http://www.chromium.org/administrators/policy-list-3#DiskCacheDir for details.
Hi, I use several different browsers and am trying to organise them all to have an easily located cache, for example C:\Cache\Cache_Firefox\
But I’m having problems following the instructions in this article for Google Chrome. The required syntax in the properties Target field has too many … ” – and spaces …
I’ve tried various combinations and get either a Problem with the Properties shortcut, or if I enter a string that is accepted by Properties then Chrome starts with an error message and wont go any further… I’m using Windows XP SR3 and Chrome V13.0.782.220m
My unmodified Properties Target line is:
“C:\Documents and Settings\User\Local Settings\Application Data\Google\Chrome\Application\chrome.exe” [Including the ” “quotes” as shown.]
And the cache directory I would like to use is C:\cache\Chrome_cache\
Could someone please show the exact syntax of the string I should enter in my Properties Target field, clearly indicating all required “quote, space and -minus symbols… All help appreciated. Thanks in advance, Mishka.
Following syntax worked for me.
chrome.exe –disk-cache-dir=”f:tempgcache” –disk-cache-size=104857600
DO NOT copy and paste directly from browser to shortcut, it messes up double quotes and parameter gets ignored. Try pasting it into text pad then after making sure it looks ok, copy it to the shortcut.
I noticed that when Chrome updates itself (with no confirmation from the user, another thing they should fix ;) the icon gets replaced, and the parameters are gone. Be careful with this because you may be using the default cache location and size without knowing it, after the update
The registry hack is helpful, but you still need to update your shortcuts to Chrome.
On my 32-bit Win7 system, I was already using –disk-cache-dir=”r:\temp” in a shortcut to Chrome. Joy. The cache goes to R:\TEMP. The registry hack also works, say, if I open Chrome via a link in Excel. However, I’d think it’d work on unmodified shortcuts, too. No joy there.
What I did:
* Make sure chrome.exe isn’t still running when clicking on shortcut.
* Search all HDs + Ramdisk to find all data_? and f00???? files. Delete them all. Monitor 4 changes.
* Run regedt32.exe as Admin. Search registry for every mention of chrome.exe” –“%1%” and add –disk-cache-dir=”r:\temp” (temp folder created on boot by Gavotte ramdisk).
* Double-check that all my registry edits are good.
* Reboot, and test again.
* Add disk-cache-size=370000 to the line.
* Re-arrange the parameters, in case –“%1” needs to go before or after.
* See if Chrome will use ram drive cache once created. Run Chrome from a shortcut that uses R:\TEMP, confirm that R:\TEMP is used for cache, close Chrome. Re-open Chrome using a plain shortcut.
* Run cmd.exe as Admin, ‘mklink /j “C:\Users\Rusty\AppData\Local\Google\Chrome\User Data\Default\Cache” “R:\TEMP\Cache”.’ Got: Cannot create a file when that file already exists.
* Reboot, and test again.
Bravo , this is What i mean
I used these parameters on one computer and it works fine just as you say.
I noticed an improved performance immediately.
However, I did the same steps on another computer, with almost the same setup, and the chrome browser opens to my new cache file.
The same thing happens with SRWare Iron as well. I must be missing something simple but don’t know enough to know where to look.
Do you have a clue?
google chrome is my default browser.but i am not able to find chrome file in googl folder in my computer.please help me to find it?