open atlas

caching

Caching

How to make apps fast by remembering results instead of recomputing them — and the hard part: knowing when that remembered copy is stale.

9 units·46 lessons·~39 h

Start track
00

Start from zero

Before the senior material: what a cache even is, and the handful of words the rest of the track assumes you already know.
01

Caching layers: from CPU to CDN

How caches stack from L1/L2/L3 through RAM, application caches, and CDNs — and why each layer exists.
02

Cache invalidation: the hardest problem in CS

Strategies for evicting stale entries — TTL, event-driven purge, write-through, write-behind — and why getting it wrong corrupts user state.
03

Cache stampede: when one TTL expires and thousands of requests hit the DB

Why a single TTL expiry turns a hot cache key into a flash-DDoS against the origin, and the four mechanisms — locks, single-flight, XFetch, and stale-while-revalidate — that keep the database alive.
04

ETags: conditional requests and zero-byte responses

How entity tags enable conditional GET — the server returns 304 Not Modified when content unchanged, saving bandwidth and reducing latency.
05

Cache-Control: directing browsers and CDNs

The directives — max-age, s-maxage, no-store, stale-while-revalidate — that tell every cache in the chain exactly how long to keep a response.
06

Stale-while-revalidate: serve stale, refresh in background

How SWR decouples freshness from latency — serve the cached version immediately, then update it silently, eliminating the tail-latency spike of synchronous revalidation.
07

Dogpile effect: concurrent cache misses that crush the origin

When a popular key expires, all concurrent requests miss simultaneously and pile onto the database — the pattern, why it differs from stampede, and how mutex locks and probabilistic early expiry prevent it.
08

Caching system design: combining all layers

How to compose CDN, reverse-proxy, application, and database caches into a coherent strategy — choosing TTLs, invalidation triggers, and fallback paths that hold under real traffic.

Build with this track

Guided projects that exercise what you learn here.

Next track

Queues, Streams, Eventing

Letting parts of a system hand off work through message queues instead of waiting on each other — so things stay fast and survive a crash without losing a message.