▶ Interactive Lab

Cache Patterns — TTL vs LRU

Watch hits, misses, evictions on different access patterns.

Advertisement
Cache hit rate depends on access pattern + replacement policy.

What you're seeing

LRU: evict the least-recently-used. Good for temporal locality.

TTL: evict by age regardless of access. Good for time-bounded data.

LFU: evict the least-frequently-used. Good for heavy-tail popularity.

★ KEY TAKEAWAY
LRU: time-based. LFU: frequency-based. TTL: age-based. Pick by access pattern.
▶ WHAT TO TRY
  • Click Random access to fill the cache.
  • Switch strategies — see which evicts what.