Networking & Protocols (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
HTTP Caching Headers Matrix: `ETag`, `no-cache`, `no-store`, and `immutable`.
senior LevelMost AskedSystem DesignHTTP & REST APIs
In Simple Words:
| Header | Meaning |
|---|---|
Cache-Control: no-store | Never cache! Browser and CDNs must not save any copy (used for bank statements, sensitive PII). |
Cache-Control: no-cache | Cache the file, but must revalidate with origin server before every single use via ETag! |
ETag / If-None-Match | Hash fingerprint of file content. Server returns 304 Not Modified (0 body bytes) if unchanged. |
immutable | Used with hashed bundles (app.a8f9b2.js). Informs the browser that this URL will never change, eliminating 304 revalidation checks on page reload. |