Skip to content

Instantly share code, notes, and snippets.

@noromanba
Last active February 6, 2017 20:11
Show Gist options
  • Save noromanba/5789292 to your computer and use it in GitHub Desktop.
Save noromanba/5789292 to your computer and use it in GitHub Desktop.
Chrome(mium) cahche on ramdisk

Google Chrome cache to ramdisk optimization

performance improvements when running within slow I/O device

  • if install to flash-drive(aka pen-drive, flash-memory)
  • e.g. Linux working on flash-drive

command line option

add option to launching menu like this;

google-chrome %U --disk-cache-dir="/ramdisk/cache/google-chrome"

option --disk-cache-dir same in use on terminal and run-dialog

πŸ‘

  • easy
  • auto create directories
  • like mkdir -p

πŸ‘Ž

  • don't apply globally
  • e.g. invoke by somebody application
  • some cache-files on default cache dir

symbolic link

cache dir makes up to symlink, like this;

DEF_CACHE=~/.cache/google-chrome
RAM_CACHE=/ramdisk/cache/google-chrome

rm -rf "$DEF_CACHE" # remove default cache dir
mkdir -p "$RAM_CACHE"
ln -s "$RAM_CACHE" "$DEF_CACHE"

so symlink like this;

knoppix@Microknoppix:~$ ls -l ~/.cache/google-chrome 
lrwxrwxrwx 1 knoppix knoppix 28  6月 10 06:51 /home/knoppix/.cache/google-chrome -> /ramdisk/cache/google-chrome
knoppix@Microknoppix:~$ 

πŸ‘

  • apply in globally
  • all caches to ram

πŸ‘Ž

  • little bit technical
  • not create child directories
  • must be exist dest-dir
  • i.e. /ramdisk/ has not child dir, cache-files has gone(or nothing)

if change to useful, simplify symlink like this;

$ ln -s /ramdisk ~/.cache/google-chrome

mount point /ramdisk absolutely exist, but might be collision to other application caches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment