To cut repeated transfers and unnecessary origin work, set an explicit cache policy for each response: let reusable content stay fresh for an appropriate period, validate stored copies when they may have changed, and keep personal data out of shared caches. HTTP caching can reduce repeat requests, but the result depends on your response headers and, when used, the rules of your CDN or reverse proxy.
How HTTP caching avoids repeated work
A browser or intermediary cache can retain a response and reuse it when HTTP rules say it is still fresh. A fresh hit can avoid fetching the representation from the origin again. Once a stored response is stale, a cache may need to contact the server to check whether it has changed; validators can make that check smaller than downloading the full body again. The rules for freshness, storage, and validation are defined in RFC 9111.
There are different cache layers. A browser cache is associated with a user’s client; a shared cache, such as a proxy or CDN, can serve multiple users when the response is suitable for sharing. A directive that is safe for a browser does not automatically mean a shared cache should store or reuse that response. Set policy based on the content, its change rate, and who may receive it.
Set the response policy with Cache-Control
Use the response’s Cache-Control header to express what caches may do and how long a response can be fresh. Directives are not interchangeable “caching on/off” switches. The MDN Cache-Control reference describes the available directives; the normative behavior is in RFC 9111.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
| Directive | What it means | Typical use |
|---|---|---|
max-age=<seconds> |
Gives a response an explicit freshness lifetime. A cache can reuse it while it is fresh, subject to the applicable rules. | Content that can be reused without checking for changes during the chosen period. |
no-cache |
Allows storage, but requires successful validation before a stored response is reused. | Stable URLs whose content should be checked for changes, such as non-personalized HTML. |
no-store |
Directs caches not to store the response. | Responses that should not be retained by caches. |
private |
Restricts storage to private caches rather than shared caches. | Responses intended for an individual user’s browser, not a shared intermediary. |
no-cache does not mean “do not store”: a cache can keep a copy and ask the origin whether it is still valid before reuse. no-store is the directive for telling caches not to store a response. Choose between them according to whether retaining a copy for validation is appropriate.
Use validators to check stale responses efficiently
An ETag identifies a representation with a validator, while Last-Modified supplies a modification-time validator. When a cached response becomes stale, a client or cache can send a conditional request using If-None-Match or If-Modified-Since. If the selected representation has not changed, the server can return 304 Not Modified: the cache reuses its stored body rather than receiving the full representation again. If it has changed, the server returns the new representation. See MDN’s conditional requests guide and its ETag reference.
Rank #2
- Send a cacheable response with an
ETag, aLast-Modifiedvalue, or both, when you can reliably determine whether the representation has changed. - After the stored response becomes stale, let the client or cache validate it with
If-None-MatchorIf-Modified-Since. - If the representation is unchanged, return
304 Not Modified; if it changed, return the new representation and its current metadata.
If both validators are present, RFC 9111 says If-None-Match takes precedence over If-Modified-Since during validation. A validator saves the response body when the representation is unchanged; it does not, by itself, prevent the validation request from reaching the server.
Choose a policy for each kind of resource
Fingerprint static assets for long freshness
For files such as app.7f3a2.js or styles.a1b2.css, a long freshness period is practical when the URL contains a content fingerprint and changes whenever the file changes. Publish the changed file under a new URL, then update the HTML or manifest that points to it. This lets caches keep using the old copy for the old URL without confusing it with the new version. web.dev’s HTTP cache guide gives Cache-Control: max-age=31536000 as a one-year example for fingerprinted resources; that is an example policy, not a universal lifetime.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #3
Do not apply the same long-lived policy to a stable asset URL whose contents can change in place. A cache cannot infer from an unchanged URL that the file was replaced at the origin.
Revalidate stable HTML and frequently updated resources
If the URL must remain stable but the representation can change, allow storage and require revalidation before reuse. For non-personalized HTML, MDN’s example uses Cache-Control: no-cache with validators: caches can retain the body, but check whether it remains current before serving it. An unchanged page can be confirmed without retransmitting its body.
Rank #4
Apply the same reasoning to an API response or another frequently updated resource: decide whether a stored copy is safe, how quickly it must reflect changes, and whether the server can efficiently validate it. No single lifetime fits every endpoint.
Keep personalized responses out of shared caches
A response containing user-specific information must not be reused by a shared cache for another person. Use a policy that reflects its audience; private is appropriate when a response may be cached in the user’s private cache but should not be stored in a shared cache. Where the response should not be retained at all, use no-store. Treat privacy and cache scope as part of the response design, not as an afterthought to performance tuning.
Best Value
Treat a CDN as a separate cache layer
HTTP standards describe cache behavior, but a CDN or reverse proxy can also apply provider defaults and explicit edge rules. Those rules may affect which responses are cached, how cache keys are formed, and how validators behave. Cloudflare documents its own default cache behavior and ETag handling; these are examples of Cloudflare behavior, not guarantees for every CDN. Its documentation notes, for example, that response transformations can affect weak ETags.
Check the deployed provider’s rules alongside the origin’s headers. A response’s cache status and headers observed through the CDN may differ in effect from what you expect by reading the origin configuration alone.
Verify the behavior in your deployment
- Inspect the actual response headers for each resource type, including
Cache-Controland anyETagorLast-Modifiedvalidator. - Test a repeat request while the response is fresh, then test again after it becomes stale. Confirm that the first can be served from cache and that validation uses a conditional request when appropriate.
- For an unchanged representation, confirm that validation can produce
304 Not Modified; for a changed one, confirm that the new body is returned. - Check that personal responses are not shared, and review the cache key to ensure requests with meaningfully different representations are not treated as interchangeable.
- If a CDN or reverse proxy is present, inspect its cache status and configuration in addition to the origin response. Confirm that provider rules match the policy you intended.
RFC 9111, Section 4.2.4, sets a constraint on stale content: “A cache MUST NOT generate a stale response unless it is disconnected or doing so is explicitly permitted by the client or origin server.” That is a standards requirement, not a performance recommendation.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




