How to move the user cache directory [~/.cache] out of the /home directory to another partition

Solution 1:

If you don't care about keeping the stuff there across reboots, you can use tmpfs to store the cache.

Set something like the following in /etc/fstab:

tmpfs /home/someuser/.cache tmpfs defaults,size=512M 0 0

Now, your .cache will be stored in memory instead of on disk, though if you have insufficient memory it could end up being swapped out.

A more traditional approach would be to move the directory to wherever you like and symlink it as appropriate:

mv ~/.cache /some/other/place
ln -s /some/other/place/.cache ~/