Skip to content
StackDecode
System Design
7. Caching ArchitectureAnimated

Client-Side Caching

Storing data on the user's device.

The idea

Browsers and apps keep files and API responses locally so repeat views need no network.

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 sends cache headers
  2. 2Client stores the response
  3. 3Next time it checks freshness
  4. 4Uses the local copy if valid

Where it is used

Static assets and offline apps.

Watch out for

You cannot force clients to drop old copies. Use versioned URLs.

Related