dcreager.net

Cache directory tags

2024-01-30

There is no consensus on where to put cache directories, even though the correct answer is the XDG base directory specification (i.e., ‘$HOME/.cache/$PROGRAM’). Given that, there is a convention to add a special tag file (called CACHEDIR.TAG) to signal that a directory (and all of its recursive contents) are a cache that can be thrown away and rebuilt if needed.

XDG base directory specification

Cache directory tagging specification

Filesystem organization