Skip to content
Latchkey

What Is Cache Eviction?

Cache eviction is the process of deleting entries from a cache when it exceeds a size limit or when entries age out. Policies such as least-recently-used (LRU) or least-frequently-used decide what goes first. CI caches commonly enforce a total size cap and evict the oldest or least-used entries to stay under it.

Why it matters

Caches are bounded, so eviction is inevitable, and it directly shapes the hit ratio: aggressive eviction discards entries you would have reused. Understanding the policy and the size cap helps you avoid thrashing, where large or numerous entries evict each other and the cache stops helping.

Related concepts

  • Common policies: LRU and age-based expiry
  • Size caps force eviction of older or rarer entries
  • Eviction thrashing collapses the hit ratio

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →