HTTP response guides

Compare browser and shared-cache freshness from a saved response

·

A browser and an intermediary can receive the same response and use different freshness lifetimes. Read the declared lifetime together with a recorded Age to explain where their estimates diverge.

Cache-Control Header Analyzer

Compare two freshness lifetimes in the saved response

Load example and select Analyze Cache-Control. The HTTP 200 block has two Cache-Control fields and Age of 150 seconds. Both directive lines contribute to the report.

The Private cache card uses 120 seconds from max-age and shows stale at the supplied Age. The Shared cache card uses 600 seconds from s-maxage and shows 450 seconds remaining. The shared card also shows that validation is required when stale.

Enter 600 in Age in seconds and analyze again. At that exact boundary the shared snapshot is stale and both cards show zero seconds remaining.

RFC 9111 HTTP caching and freshness

Separate freshness from permission to reuse

Return Age to 150 and add no-cache to the first Cache-Control line. The declared lifetimes stay at 120 and 600 seconds. The reuse line now says to validate before reuse, including when the age snapshot is fresh.

The example also contains stale-while-revalidate. This extension defines a grace window for serving stale responses during validation. The header combines it with shared-cache revalidation semantics from s-maxage. Compare your cache configuration before assuming that it will serve during the grace window.

RFC 9111 HTTP caching and freshnessRFC 5861 stale Cache-Control extensions

Compare a saved report with the recorded response

Download the report and compare the response status, Age and both lifetime sources with the original lines. If you paste a chained capture, confirm that the selected block contains the response you intended to review.

When two max-age values are recorded, the analyzer leaves the affected lifetime unavailable. RFC 9111 allows a recipient to use the first occurrence or treat the response as stale. Check the service or proxy that added the second value. The report also leaves lifetime unavailable when explicit Cache-Control freshness is missing.

RFC 9111 HTTP caching and freshness

Common questions

Does a missing Age mean that a response is new?

The tool leaves the snapshot unavailable. HTTP current age also depends on Date, response timing and time in storage. Supply a known Age if you have one.

What happens to a qualified private directive?

A value such as private="Set-Cookie" restricts shared storage of the named field. Some caches implement this as a restriction on the entire response.

Sources

Put it into practice.

Related guides