Ever since I’ve been using my SSD in my MacBook Pro (the hard drive that was in it is still there, I just had to take the optical drive out and replace it with a caddy so that I can use my SSD and the HDD in the same laptop), I’ve been looking for ways to keep the overall life expectancy as high as possible. Once simple way of doing this is by moving the cache directory for your browser off of the SSD and somewhere else. This post will teach you how to do this for Chrome in Windows, Linux, and Mac OS X.
One major reason in doing this (for SSD users) is to keep from having thousands and thousands of reads/writes being done while you browse the Internet. If you’ve been browsing the web for an hour or two, or haven’t cleared out your cache in a long time, maybe you should check out all of the files that have been written to your cache directories.
Mac & Linux
First, I’ll start with Mac & Linux. There are a few ways of changing your cache directory for Chrome:
- Running Chrome through the command line with “–user-data-dir=”NEW_LOCATION”” – This is just a temporary solution, and Chrome will have to be run like this every time you want Chrome to use this new directory.
- Make a symbolic link – Think of these are shortcuts that are targeted towards another directory.
We’ll be talking about number 2. It’s very easy and straightforward.
- Open Terminal.
- Run “ln -s TARGET_DIRECTORY NAMEOFSYMLINK” – Replace TARGET_DIRECTORY with where you’d like your new cache to be stored. Replace NAMEOFSYMLINK with the name of the symlink file, which should be Cache.
- There should be a symlink in your home directory. Move this file to where Chrome’s current cache directory is located. For Mac OS X, it’ll be in “~/Library/Caches/Google/Chrome/Default“. I’m not sure where it’s located in Linux, but you can find it if you browse around a little bit. You’ll also need to delete the “Cache” directory that’s already there.
So there you have it. You’ve successfully changed the location of Chrome’s cache in Mac OS X and/or Linux.
Doing this in Windows is basically the same thing. We’ll be using a freeware command-line based application called “Junction” to create symlinks for Windows to use. Since Windows 2000, Windows has supported symlinks but there weren’t any tools used to create them, so that’s where “Junction” comes into play.
- Download “Junction” here: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
- Extract “junction.exe” to your desktop.
- Open Command Prompt.
- Run cd Desktop.
- Run junction OLD_DIRECTORY NEW_DIRECTORY. Refer to the below image on what directories you should put.
So there you [also] have it. You’ve just used a simple program called “Junction” to create a symlink in Windows.
Follow me on Twitter: http://twitter.com/gumballtech