Proposal: cache directory tagging convention

Bryan Ford baford at mit.edu
Fri Jul 23 00:21:16 EEST 2004


Anthony Metcalf wrote:
>Martin Waitz <tali at admingilde.org> wrote:
>> it's even simpler than that: don't use /var/cache!
>> use a directory in your home directory and everything just works.
>
>My point was, /var/cache is there to use for this, and it solves the original 
>posters question of how to seperate cache data in the case of backups, you 
>only have 1 directory to exclude, not many directories, some of which may 
>not exist in a home tree.
>
>I am willing to accept a good explination of why /var/cache wont work.
>But not, it's simpler to use home.

The /var/cache directory indeed usually seems to be non-world-writeable 
(certainly it is on the Linux distros I'm familiar with).  The intended 
purpose of /var/cache appears to be to be used only by applications that are 
a basic part of, or at least distributed with, the base OS itself, and for 
which appropriate permission schemes are set up (typically involving 
systemwide daemons or su-root programs in some way) so that an application 
can safely share a cache among multiple users.  For example, on my SuSE 9.1 
system, I see that /var/cache seems to be used to store cached fonts, 
formatted man pages, and for a couple other random system programs.  But 
certainly there appears to be no way that unprivileged or user-installed 
programs can be expected to use /var/cache; this directory apparently just 
wasn't intended for that purpose.  It makes sense, after all, considering 
that the file system hierarchy standard is primarily intended to standardize 
the directory structure of Linux _distributions_, i.e., the software that 
comes pre-packaged with a base OS, and not to standardize random applications 
that users are expected to download off the web or buy on CD and install 
themselves.

Outside of users' home directories, the closest thing to a "standard" place 
for random application-managed caches appears to be /var/tmp (which KDE 
uses), which _IS_ world-writeable, is supposed to be located on a reasonably 
large local partition (not the root partition, like /tmp), and most backup 
software can easily be configured to avoid backing it up.  But as I already 
discussed in earlier E-mails and in the proposal on my web page, there are 
also good reasons applications might not want to keep their caches 
in /var/tmp.

My point is ultimately just that since there appears to be no hope at least in 
the immediate future of getting everyone to agree on a single, standard 
location for cache directories (for both technical and political reasons), it 
would be very useful if we could at least agree on some very simple, low-cost 
mechanism for making those directories uniformly identifiable.

Cheers,
Bryan



More information about the xdg mailing list