$linuxjunkies
>

XDG_CACHE_HOME

also: XDG cache directory

An environment variable that specifies the directory where applications should store non-essential cached data that can be safely deleted without breaking functionality.

XDG_CACHE_HOME is part of the XDG Base Directory specification, a standard for organizing user data in Linux. It defines where cache files—temporary data that speeds up operations but isn't critical—should be stored.

If not set, it defaults to ~/.cache. Applications following the XDG standard use this location instead of cluttering the home directory with hidden cache folders. For example, a web browser might store downloaded webpage images in $XDG_CACHE_HOME/browser-name/ rather than ~/.browser-cache/.

You can customize it by exporting in your shell: export XDG_CACHE_HOME=/custom/cache/path. Since cache is non-essential, you can safely delete XDG_CACHE_HOME contents to free disk space without data loss.

Related terms