title: What is the Correct Location for Application/Script Cache Files on Unix and Linux?
body: <p>I'm working on a script which so far has only needed temporary files which I can quite happily throw into <code>/tmp</code>, however I now have some data I've generated that is very costly and time-consuming, so I'd like to store some of it in a cache file somewhere.</p>
  
  <p>Now, on OS X the best location is somewhere in <code>$HOME/Library/Caches</code>, however I'm not sure where the best location is for common versions of Linux and Unix.</p>
  
  <p>I know of <code>/var/caches</code>, but this seems like it should really be used by system services etc. rather than user-specific programs and services. Are there any more correct locations?</p>
  
  <p>I realise some systems may have different preferred locations, so I'd appreciate a summary of some of the main ones, as well as the most compatible options (I'll have my script run through them and pick the best).</p>