GameCachingBeginnerCache hits, misses, LRU, TTL, and stale datacacheLRUTTLhit rateGamePractice cache hits, misses, LRU eviction, TTL, stale data, cache warming, and hit rate through an interactive backend caching game.Cache Eviction LabCachingBeginnerCache hits, misses, LRU, TTL, and stale data/games/cache-eviction-lab/
Predict cache hits and misses as requests flow through an LRU cache, then experiment with TTL behavior and stale data tradeoffs.
Concept
Cache hits, misses, LRU, TTL, and stale data
Difficulty
Beginner
Play time
5-8 minutes
Path
Data & Performance
Interactive scenario
Playable game area: Make the next backend decision
Use the controls below. Feedback appears immediately and final scores stay in this browser.
Concept notes
Why this decision matters
Cache Eviction Lab is focused practice for Cache hits, misses, LRU, TTL, and stale data. It explains why each answer is safe, risky, or production-ready.
Caching is a tradeoff between speed, capacity, and freshness. This lab makes those moving parts visible through a small request sequence.
Learning objectives
Predict cache hits and misses from a request sequence.
Visualize LRU eviction as cache capacity fills.
Understand how TTL changes freshness and hit rate.
How to play
Review the next request key and current cache slots.
Predict whether the request will be a hit or miss.
Watch the cache update and compare your prediction to LRU behavior.
Scoring
Correct hit/miss predictions add points.
Streaks reward careful state tracking.
TTL mode is slightly harder and can produce different outcomes.
Backend concept notes
A cache hit avoids slower work, such as database reads or remote API calls. A miss repopulates the cache and may evict another item.
LRU evicts the least recently used item. TTL expires items based on age, which can protect freshness but reduce hit rate.
Common mistakes
Thinking cache capacity is unlimited.
Forgetting that reading an item updates its recency in LRU.