Disable Google Chrome cache on OSX

Google Chrome does not have a simple way of managing the size of the caches from within the product. The main way that it the cache size and location can be controlled is via command line switches.

--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1

On OS X you have 2 choices; edit the actual Application bundle to add a shell script to launch the main executable with the relevant parameters or create a wrapper application in ActionScript or another scripting language to launch the program, again with relevant parameters. Neither solution is optimal, as if you modify the Chrome application bundle the change will be removed after a software update. The other option of launching a separate Chrome instance leads to potentially 2 icons in the dock.

There is a third way to use the Chrome profiles system to set the same parameters as used on the commend line but from a separate PLIST file. The benefit of doing this as the parameters survive a software update from Google and no hacking using scripting is required. Here is an example file which should be placed in the system /Library/Preferences directory.

The reason I wanted to do this was after discovering that Chrome had over 2GB of cache files stored and the response time was very poor. Disabling the cache means pages now load almost instantaneously.