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.

Read also:  How to block automatic Google Chrome updates

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"

chrome cache location size

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:

  1. Open the Windows Registry by tapping on Windows-R, typing regedit and hitting the enter key.
  2. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium
  3. Add the Dword DiskCacheSize with a right-click on Chromium and the selection of new > Dword (32-bit value) from the context menu.
  4. Give it a value in bytes.
  5. 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.

Please share this article

Facebooktwittergoogle_plusredditlinkedinmail



Responses to How To Change Google Chrome’s Cache Location And Size

  1. krishil.com October 30, 2010 at 9:25 am #

    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?

  2. Michael July 9, 2011 at 9:32 am #

    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?

  3. Dea July 30, 2011 at 9:05 am #

    Bravo , this is What i mean

  4. Rusty Shack March 12, 2012 at 6:04 am #

    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.

  5. golimar April 1, 2012 at 11:33 am #

    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

  6. Mishkatel July 15, 2012 at 8:42 am #

    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.

    • FQazi July 18, 2012 at 4:33 pm #

      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.

  7. Engywuck September 27, 2012 at 11:25 am #

    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.

  8. Deividas February 11, 2013 at 6:21 am #

    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?

  9. Ogrfnkl February 17, 2013 at 11:08 pm #

    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?

    • Ogrfnkl February 17, 2013 at 11:18 pm #

      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. :(

    • MrChris April 4, 2016 at 4:18 am #

      What are the 5 or 6 keys that need to be modified? Please list them ...

  10. Naki March 16, 2013 at 7:36 am #

    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. :)

  11. Naki March 16, 2013 at 9:09 am #

    I see you edited it now! Thank you. :)

    • Martin Brinkmann March 16, 2013 at 9:13 am #

      I finally looked it up. It is WordPress that is automatically modifying quotes. I write about how I have changed that soon.

      • Naki July 26, 2013 at 10:16 am #

        I write about how I have changed that soon.

        It was March - now it is almost August, please define "soon"? :)

  12. Adam July 17, 2013 at 10:23 am #

    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.

    • Adam July 25, 2013 at 2:28 pm #

      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.

      • Martin Brinkmann July 25, 2013 at 2:41 pm #

        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

      • Adam July 25, 2013 at 3:35 pm #

        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...

    • Naki July 26, 2013 at 9:58 am #

      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.

      • Adam July 26, 2013 at 10:33 am #

        Why would the Host OS matter? Completely transparent to the OS and browser.

        Guest OS is Windows7 x64.

        Chrome 28.0.1500.72 m.

  13. Helen September 3, 2013 at 12:05 am #

    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.

  14. zelldeb October 5, 2013 at 3:55 am #

    this did not work for me, it said the name specified in the target field was not valid

  15. trumpman November 23, 2013 at 7:58 am #

    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.

    • Naki November 23, 2013 at 2:14 pm #

      trumpman, no - the quotes and double dashes are just fine.
      The quotes were bad originally, but then the author fixed them.

      • trumpman November 26, 2013 at 6:23 pm #

        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.

  16. Vic February 15, 2014 at 2:06 am #

    On Windows 8.1, the registry tag HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium does not exist. Any idea where to find it?

  17. Mark March 31, 2014 at 9:26 pm #

    Same problem here. Using Windows 7 though, the registry tag HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium does not exist. Any ideas?

    • Martin Brinkmann March 31, 2014 at 9:31 pm #

      Which edition of Windows 7 are you running, and which version of Google Chrome?

  18. Mark April 2, 2014 at 8:37 pm #

    I'm using Win 7 Home Premium, SP1 and Chrome version 33.0.1750.154 m

    • Martin Brinkmann April 2, 2014 at 8:38 pm #

      Your operating system does not ship with the Group Policy Editor, that's the reason why this won't work.

  19. Software Arrogance May 9, 2014 at 1:47 am #

    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.

  20. Anonymous June 6, 2014 at 4:23 am #

    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.

  21. Denis January 13, 2015 at 10:43 pm #

    Wow guys!!! very useful and understandable article. Thanks.

  22. Denis January 18, 2015 at 10:10 pm #

    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:

  23. Rick May 11, 2015 at 8:38 pm #

    The ultimate in limiting the cache:
    --disk-cache-dir=null

  24. Neves October 29, 2015 at 1:29 pm #

    This article is out off date. Please update this!

    • Martin Brinkmann October 29, 2015 at 1:31 pm #

      What part of it is outdated?

    • Naki October 29, 2015 at 2:01 pm #

      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.

  25. Anonymous December 27, 2015 at 2:15 pm #

    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.

  26. ankurk1 January 19, 2016 at 10:14 am #

    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

  27. Jeff Kart March 14, 2016 at 7:44 pm #

    yay! thank you!!! problem solved.

  28. Patrick Bouster February 1, 2017 at 5:11 pm #

    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.

Leave a Reply