WindowsmacOSLinux

Where Is the ccache Cache Directory?

ccache compiler cache directory on Windows, macOS and Linux, plus stats and cleanup commands.

Last updated

ccache caches compilation objects in a single directory, defaulting to the OS cache location. Hits turn rebuilds into near-instant replays.

The directory is disposable by design. Size caps and LRU cleanup keep it bounded, and wiping it never breaks a build.

Where ccache stores this, by platform

Windows
%LOCALAPPDATA%\ccache

Default cache home. Override with CCACHE_DIR. Manage with ccache -s, -C and -M rather than deleting by hand.

macOS
~/Library/Caches/ccache

Same role. Confirm with ccache -s which prints the effective cache directory.

Linux
~/.cache/ccache

Follows the XDG cache home. Custom XDG_CACHE_HOME values relocate it automatically.

Frequently asked questions

How do I check or clear the ccache cache?

Run ccache -s for hit rates and size, ccache -C to wipe, ccache -M to resize. The cache dir holds hashed objects; wiping only costs rebuild time, never correctness.

How do I move the ccache directory?

Set CCACHE_DIR before compiling. Useful for redirecting cache to faster or larger drives, or sharing one cache across containers with proper namespacing.

Notice an outdated path? Let us know.