What is the purpose of every user's ~/.cache directory?
Under which circumstances can it be deleted, when should one be careful about its contents?
What is the purpose of every user's ~/.cache directory?
Under which circumstances can it be deleted, when should one be careful about its contents?
This is by no means a definite answer.
According to the XDG Base Directory Specification, $XDG_CACHE_HOME which defaults to $HOME/.cache holds
[...]user-specific non-essential (cached) data[...]
It is however not specified what constitutes 'non-essential data'. Furthermore an application might not play by freedesktop rules and put whatever it wants in .cache.
Browsing through my cache folder, I find things like
software-center. Wasn't sure about that. Contains a file apthistory.p with your - well - history of apt. Moved it out of the way and it was recreated on the next start of the Ubuntu Software Center. apt-file. Will be downloaded anew if deleted.compizconfig-1. Contains binary files; compiz seems to cache its configuration in optimized form from ~/.config/compizconfig-1.dconf. This directory actually doesn't belong to $USER but root. Mine contains a single non plaintext file user. Since you can't delete it anyway without sudoing... No problem.In summary, I believe it perfectly safe to empty the cache folder. In fact I do this from time to time and never experienced faulty behaviour afterwards.
This is not a guarantee though, just my two cents and a (somewhat) educated guess.