Skip to content
Latchkey

How to Work Within the 10GB Cache Limit and Eviction in GitHub Actions

GitHub keeps up to 10 GB of cache per repository and evicts least-recently-used entries once you exceed it.

When total cache size for a repo crosses 10 GB, GitHub evicts the least recently used entries until it is back under the cap. Unused caches are also removed after 7 days. Keep keys tight so big, stale caches do not push out the ones you rely on.

Steps

  • List current caches with the gh CLI to see what is consuming space.
  • Delete stale caches you no longer need.
  • Narrow paths and keys so each cache stays small.

Inspect and prune

Terminal
# list caches sorted by size
gh cache list --sort size --order desc
# delete a specific cache by id or key
gh cache delete <cache-id>

Gotchas

  • Caches unused for 7 days are removed regardless of the size cap.
  • A single huge build cache can evict many small dependency caches; split them.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →