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.
- 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
- 1Server sends cache headers
- 2Client stores the response
- 3Next time it checks freshness
- 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.