Skip to content
StackDecode
System Design
7. Caching ArchitectureAnimated

Browser Caching

The browser reuses downloaded resources.

The idea

Headers like Cache-Control and ETag tell the browser how long a file is fresh and how to revalidate.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

CPU registersL1/L2 cacheRAMSSD / networkRemote origin
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Each level is bigger, slower and cheaper than the one above.

step:
1/4
at:
CPU registers
1/8

The green dot is a request moving through the system.

Step by step

  1. 1Server sets Cache-Control
  2. 2Browser stores it
  3. 3Next load uses it without a request
  4. 4After expiry it revalidates

Where it is used

Websites.

Watch out for

Cached old JavaScript after a deploy. Fingerprint file names.

Related