Guides
How to make CI caches actually persist
Caches are configured but hit rate is low.
6 min read
Caches are configured but hit rate is low.
Why it happens
Keys include volatile inputs, or the cache is scoped to a branch that never gets a warm copy.
How to fix it
- Print the computed cache key and check it is stable across runs
- Key on lockfiles, never on the commit SHA
- Add restore-keys with a shorter prefix so near-misses still restore
- Warm the base branch cache on a schedule so new branches start warm
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to work around the 10 GB cache limitYour caches exceed 10 GB per repository and start silently evicting.How to share a build cache across repositoriesEach repository maintains its own cache for the same shared dependencies.How to share a Docker cache between jobsEach matrix leg rebuilds the same layers.How to fix Docker cache invalidationDocker layers rebuild even when the relevant files did not change.