Understand validators before long cache lifetimes.
Cache configuration is easier to reason about when freshness and validation are treated as separate decisions.
Editorial team ·
Decide what may be reused
A static image with a versioned filename can often stay fresh longer than an HTML page whose links may change. Cache-Control directives tell caches whether a response can be reused without contacting the origin and under which conditions. Shared caches have different privacy implications from a browser cache. A resource that contains personalized information should not inherit public caching rules merely because it ends in .html.
Use validators consistently
An ETag identifies a selected representation for conditional retrieval. Last-Modified provides a timestamp-based validator with coarser resolution. When a client sends If-None-Match and the representation has not changed, the server can return 304 Not Modified without transferring the body. A 304 is meaningful only in relation to a stored representation. Do not generate unstable validators on every request or the cache will needlessly refetch content.
Understand the stale page report
When a visitor sees old content, identify which cache supplied the response. Check Age, Cache-Control, validators and the actual request path. A service worker, browser cache or intermediary can each behave differently. Invalidating everything globally may appear to fix one page while increasing load and hiding the real cause. Prefer changing the policy for the affected resource, then verify the response sequence with a fresh session.
Test both ordinary and conditional requests
Send a GET, preserve the ETag if present and repeat with If-None-Match. Examine the status and relevant headers. Repeat after an intentional content update in a controlled environment. Ensure that a representation change invalidates the old validator. Long-lived assets should usually have names that change when bytes change. This keeps the cache policy understandable without requiring a visitor to empty browser storage after every release.
Related reading
Continue with the guides index, or explore the overview for the wider context. Use a test resource on a server you control and inspect the complete response, including status and headers. Change one condition at a time, so the result remains interpretable. The guide explains protocol behaviour; it does not assert measurements from an external service.