Zloweb
RU

How web caching works

Fresh responses, validators and cache keys.

Reuse a fresh response

A browser cache or shared cache may store a response and reuse it for a later request. Cache-Control: max-age=300 gives a response a freshness lifetime of 300 seconds. The response’s current age also matters. Vary can require a cache to account for request headers such as Accept-Encoding.

Cache-Control: max-age=300
ETag: "guide-v3"
Vary: Accept-Encoding

Revalidate a stored response

Once a response is stale, a cache can send If-None-Match with the stored ETag. A 304 means the existing representation can be reused with updated metadata. The no-cache directive requires validation before reuse; no-store instructs caches not to store the response.

Observe a refresh

Open the Network panel and reload a page twice with caching enabled. Compare the source and headers for a stylesheet across requests. The Zloweb Status check asks the browser to bypass its HTTP cache so it can time a fresh fetch of a small resource.

Try the tools

Related reading

References