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.
- 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 sets Cache-Control
- 2Browser stores it
- 3Next load uses it without a request
- 4After expiry it revalidates
Where it is used
Websites.
Watch out for
Cached old JavaScript after a deploy. Fingerprint file names.