42

I don't even use this browser normally, just for testing purposes, and the directory size of "Chrome" in "AppData\Local\Google" is like 500 MB.

Is there a way I can disable page cache in Chrome?

Alex
  • 899
  • 5
  • 20
  • 32

13 Answers13

38

Just found out about this solution. You start Chrome under Windows with --disk-cache-dir=null parameter and enjoy. Works also under *nix system with /dev/null.

nicoX
  • 103
  • 6
D.Iankov
  • 1,864
  • 1
  • 16
  • 16
  • 4
    This is the best method for anything automated such as testing (i.e., karma) where extensions and user-action are not available. – JoshuaDavid Jan 30 '15 at 05:42
  • 5
    This almost worked for me, except I had to use `nul` instead of  `null`. `null` just moved the cache to a folder named null. – blade Oct 13 '17 at 13:47
  • 3
    Can confirm this works very well for automated scenarios! As @blade said, I also had to use `nul` for it to work! – Christian Droulers Oct 22 '18 at 20:10
20

You can limit the disk cache size with a very small number (say, 1 byte) with an option:

--disk-cache-size=N

Where 'N' is the cache size limit, in bytes

Perhaps, another option is also useful for a similar purpose: --media-cache-size=1

I've tried --disk-cache-size=1 in my Chromium 17.0.963.1 (under Linux), and it has an effect: the size of the cache dir has reduced tremendously!

(Now I wonder whether it's possible to put this option into a configuration file, preferrably system-wide one -- so that it will be the default without me having to replace the menu and/or hiding the executable with my own script with this option. I would like it as a default on my system as a measure for more effective usage of my SSD.)

  • 1
    To me this seems less risky than moving the cache directory. For example, if I forget to clear my cache before altering the directory, will I be left with a big old cache somewhere that sits unused forever? – gravitation May 08 '15 at 16:56
  • @BrandonThomson I wondered for a while what you mean by "moving" because my answer doesn't seem to mention "moving". I suppose you mean the solution with assigning another non-existent path to the parameter definig the place where the cache lives -- http://superuser.com/a/516582/65570 – imz -- Ivan Zakharyaschev May 08 '15 at 17:05
  • 1
    Yes, I mean that I like your solution better than the alternative solutions given. – gravitation May 08 '15 at 17:58
16

You can clear the cache regularly.

Settings -> Advanced -> Privacy and Security -> Clear browsing data

or

More Tools > Clear browsing Data

Once the cache is cleared use Incognito mode to disable caching while browsing.

The easiest way to disable browser caching in Google Chrome is simply to use its "Incognito Window" mode, similar to IE's InPrivate mode. Press CTRL + SHIFT + N to open up the relevant tab.

Some other suggestion here for normal mode, not sure if any of them work.

Moab
  • 58,044
  • 21
  • 113
  • 176
  • Chrome doesn't have Under the hood anymore. The new way to clear the cache is Settings -> Advanced -> Privacy and Security -> Clear browsing data. – Björn Lindqvist Jan 17 '20 at 10:49
  • That's the problem with answering questions about continually morphing software. – Moab Jan 17 '20 at 14:03
12

Press f12 to open the developer console. Then, under the elements tab, click the gear in the lower right corner: gear chrome dev console. On the left, there is an option to disable cache.

enter image description here

Lg102
  • 293
  • 3
  • 11
  • 15
    Please note that this only has an effect [while the developer tools are open](https://plus.google.com/114552443805676710515/posts/RzzcVZk8JFa). – Oliver Salzburg Dec 09 '12 at 11:32
5

Temporary Clearing

If you hit <Ctrl> + <Shift> + <Del> it will automatically bring up the clear cache screen.

The other option is hit F12 to reveal the developer panel and then hit the gear in the corner

Clear Cache Screen for chrome

chrisjlee
  • 3,980
  • 4
  • 22
  • 27
4

The most effective way to disable caching in Chrome is to provide it with a cache directory that does not exist. D.Iankov answer helps but the full solution looks like this:

--disk-cache-dir="z:\" --media-cache-dir="z:\" 

You need to specify both cache directories to eliminate Chrome caching. On Windows, use the above line (if you don't have a z: drive) or use any other drive that does not exist. On Linux/MacOS, /dev/null will work instead of "z:\".

The above line needs to be added to the Chrome shortcut properties. To find the shortcut on Windows, press the Start button, click into the search window and type Chrome (don't press Enter). Wait for a shortcut to Chrome to appear. Right click on it and select Properties.

In the Google Chrome Properties window, find the field labelled "Target" and add the above line to the end of it. If the path to chrome.exe is surrounded by double-quotes, make sure that the above line is added after the closing double-quotes.

IvanD
  • 149
  • 2
  • `--media-cache-dir` is no longer a switch. – Clint Pachl May 25 '20 at 02:16
  • You can't edit the shortcut properties from the search window. There is no Properties option when you right click on it. You have to actually create a shortcut to Chrome somewhere with the appropriate modifications to the Target, and pin that to your task bar and/or start menu. – RobH May 18 '22 at 18:36
3

Try the Cache Killer extension, which effectively disables the browser cache.

Automatically clear your browser cache before loading a page. Can be enabled/disabled with a single mouse click.

This extension allows you to easily disable caching in Chrome. When Cache Killer is activated, it will clean your Browser Cache before every page load. With just one click you can disable or enable this feature.

galacticninja
  • 6,188
  • 16
  • 78
  • 120
  • I installed *Cache Killer*, but it doesn't seem to do anything (yes, I have turned it on). – Zaz Jun 06 '15 at 00:34
  • 1
    This solution will also not help if the reason for wanting to disable disk caching is to reduce disk writes. – Daniel Saner Sep 21 '16 at 20:55
2

The best way to do this if using Windows is to locate the ”Cache’ folder under “%localappdata%\Google\Chrome\User Data\Default\Cache. Right-Click, Properties, [Security] Tab. [Advanced] button, [Disable Inheritance], ‘Removal All’. There should be no object listing, click [OK]. [OK] again. Now Chrome wont be able to cache anything. You can do the same to the MediaCache and GPUCache and all other Cache folders as well.

2

For those who don't want to use the flags above and want to disable the cache permanently, I found another way on *nix systems to disable cache. It is possible to link the google chrome cache folder to /dev/null, disabling it. The commands for Linux look like this:

rm -rf ~/.cache/google-chrome
ln -s /dev/null ~/.cache/google-chrome

This should work on linux. I don't know where the chrome cache is stored on mac os, so I couldn't generate commands for mac os.

ElSmacko
  • 21
  • 1
1

Google Chrome version 54.0: Go to Developer Menu -> Network, and on the first row underneath that, there's a checkbox to disable cache

1

On MacOS run this from the terminal to disable disk caching:

defaults write com.google.Chrome DiskCacheDir -string /dev/null
onetrickpony
  • 141
  • 1
  • 9
  • Do you need to run this when Chrome is ***not*** running? (That's typically the case, but it is worth mentioning.) – iconoclast Jul 11 '18 at 01:24
1

For Ubuntu, run this in the terminal. It changes the program shortcut.

sudo sed -i 's/google-chrome-stable.*/& --disk-cache-dir=\/dev\/null/g' /usr/share/applications/google-chrome.desktop
afelaho
  • 277
  • 1
  • 3
  • 9
0

In my opinion, there is no justifiable reason for the amount of data that gets cached by Chrome. I wish someone would do an independent study to emphasize how ridiculous the situation actually is.

And since it doesn't provide settings to cap the amount that is cached. The best answer to your question is this:

Uninstall Chrome. This seems to cap its cache quite well; its the best way to reduce the memory it wastes and it is the best way to protest the fact that it doesn't provide you options to not cache anything longer than your browser's session.

At today's bandwidths, Web pages load quickly enough without caching anything! And even if not caching causes a brief delay, it is your right to endure that delay. If your browser doesn't even give you the option of auto-clearing cache after each session, that is a violation of your freedom in my opinion. Consider LibreWolf as an alternative.

LonnieBest
  • 1,606
  • 8
  • 31
  • 42