Proposal: cache directory tagging convention

Bryan Ford baford at mit.edu
Thu Jul 22 22:34:22 EEST 2004


On Tuesday 20 July 2004 17:04, I wrote:
> Hi!  I've been referred to this list as the most appropriate place to
> discuss an idea I've recently written up and posted here:
>
>       http://www.brynosaurus.com/cachedir/

Kevin Krammer responded:
>The XDG base directory specification proposes to use a directory where 
>applications can then put their cache directories:
>
>from
>http://freedesktop.org/Standards/basedir-spec/0.6/ar01s03.html
>
>"$XDG_CACHE_HOME defines the base directory relative to which user specific 
>non-essential data files should be stored. If $XDG_CACHE_HOME is either not 
>set or empty, a default equal to $HOME/.cache should be used."

Then Anthony Metcalf pointed out:
>Doesn't section 5.5 of the file system Hierarchy Standard cover this?
>
>i.e. /var/cache exists for this purpose. 

It is a very good thing that effort is being put forward to standardize at 
least somewhat the issue of _where_ applications should put their caches.  
But even if all applications adhered to one of these standards or the other 
in locating their caches, that's still two different locations (/var/cache 
and $HOME/.cache), not just one - perhaps many, if you're looking at the 
system as a whole and count each user's $(HOME)/.cache directory separately.  
And even if an application defaults to keeping its cache in a standard place 
such as /var/cache or $(HOME)/.cache, there will still be good reasons users 
might want to customize where their applications put their caches - e.g., to 
force caches onto a fast local drive when their home directory is an NFS 
mount.

In fact, I presume this is precisely the purpose of the $XDG_CACHE_HOME 
variable mentioned above.  Having this flexibility is great and necessary, 
but - How exactly is a system-wide backup utility supposed to figure out 
where _each_ _individual_ _user_ has decided to keep their cache directories 
in order to exclude them all?  Should the backup utility somehow try to 
execute or otherwise grovel through each user's startup shell scripts in 
order to find out that user's setting of $XDG_CACHE_HOME?  Such an approach 
would be rather complex, incredibly prone to security holes, and probably 
very fragile in general, perhaps to the point of absurdity - I just really 
don't think we should go there.

What we need is not only an effort to standardize the _location_ of cache 
directories, but an additional and _complementary_ convention to make those 
directories recognizable by systemwide utilities, no matter where they end 
up.  I fully support the existing freedesktop standard's approach to 
addressing the former problem, but it's the latter issue that I'm trying to 
address.

Further comments appreciated.

Thanks,
Bryan



More information about the xdg mailing list