Nerdy tech-fun(k), nonsense and everything in between and above.

15.09.11

Disable disk cache in Chromium / Google Chrome

There is no user interface in Google's browser Chrome yet to disable the disk cache, or control its size (version 14 appears to have something in the developer tools section).

But it can be done using command line options when starting the browser, and you can configure this globally for Ubuntu.

The following command line flags will use /dev/null ("the sink") as cache dir, and additionally limits it to 1 byte:
--disk-cache-dir=/dev/null --disk-cache-size=1

(I have tried just --disk-cache-size=0 or 1, but it did not appear to work as expected)

On Ubuntu/Debian, you can just add these flags to the CHROMIUM_FLAGS variable in /etc/chromium-browser/default and it will be used every time when starting Chromium.

The motivation to do this comes from me using a local (intercepting) HTTP proxy with its cache on a RAM disk. Therefore I do not want Chromium to store quite the same retrieved files on disk again.
Additionally, this is a SSD, which is not that happy about being written to in general.
Therefore /tmp is a tmpfs mount already, and the same should be the case for temporary browser files.