Caching easy
A server response includes `Cache-Control: private, max-age=3600`. What does `private` indicate?
- A The entire HTTP response is encrypted to prevent any unauthorized observation during network transit.
- B The response may be cached by the user's browser, but NOT by intermediate shared proxies like CDNs or firewalls.
- C The content is strictly restricted to system administrators and is inaccessible to standard authenticated users.
- D The cached representation is automatically invalidated and purged as soon as the browser tab is closed by the user.
Answer: B. The response may be cached by the user's browser, but NOT by intermediate shared proxies like CDNs or firewalls.
The `Cache-Control: private` directive indicates that the response contains user-specific info (like a profile page). It allows the user's *own* browser to cache it, but explicitly forbids shared intermediaries (like CDNs or corporate proxies) from storing it, preventing one user's private data from being served to another.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In the Cache-Aside pattern, what happens when the application requests data that is missing from the cache (a 'Cache Miss')?
- Why use a centralized Distributed Cache (like a Redis Cluster) over local in-memory caches on each web server?
- Setting a short TTL (e.g., 60 seconds) on a cached object helps to:
- What is the primary architectural goal of introducing a cache into a system?
- Most caching systems rely on the principle of 'Temporal Locality', which states:
- Your cache uses an LRU (Least Recently Used) eviction policy. When the cache is full, which item is removed?