Networking & Protocols (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What are HTTP Caching Headers (`Cache-Control`, `ETag`, `Last-Modified`)?
senior LevelMost AskedSystem DesignHTTP & REST APIs
In Simple Words:
Cache-Control: max-age=3600, public: Browser and CDNs cache the response for 1 hour without checking the server.Cache-Control: no-cache: Browser caches the response, but must revalidate with the origin server via ETag before using it!Cache-Control: no-store: Never cache anything (banking, sensitive data).ETag: A cryptographic hash of the content. Browser sendsIf-None-Match: "hash". If unchanged, server responds with304 Not Modified(zero body bytes!).