Header overview

Caching Headers

What caching headers control

HTTP caching headers influence whether browsers, proxies, and CDNs may reuse a response, how long that response stays fresh, and what should happen when it becomes stale. Good caching can reduce repeated downloads and server work, but the correct policy depends heavily on the kind of response being served.

A long cache lifetime can be excellent for versioned static assets and completely wrong for personalized HTML. Likewise, no-cache does not mean the same thing as no-store: no-cache allows storage but requires validation before reuse, while no-store asks caches not to store the response.

Core concepts

Three parts of useful caching

Caching becomes easier to reason about when freshness, revalidation, and cache scope are treated as separate questions.

Freshness

Directives such as max-age tell a cache how long a stored response may be reused without contacting the origin server again. Shared caches may also receive their own lifetime through directives such as s-maxage.

Revalidation

ETag and Last-Modified can act as validators. When a stored response becomes stale, the client can ask whether it changed and may receive 304 Not Modified instead of downloading the full response again.

Scope & variation

public and private influence where responses may be stored, while Vary tells caches which request-header differences should create separate cache entries. Personalized responses need especially careful treatment.

Key headers

Four headers worth recognizing

These headers describe the most common pieces of browser and intermediary caching behavior.

Policy

Cache-Control

The main response header for freshness, revalidation, storage, and cache scope. Its directives can describe very different behavior, so the complete value matters.

Read the Cache-Control reference

Validator

ETag

Identifies a particular representation of a resource. Clients can send it back with If-None-Match to check whether the cached representation is still current.

Read the ETag reference

Validator

Last-Modified

Provides a modification timestamp that can be used with conditional requests. It is generally less precise than ETag but remains useful across the HTTP ecosystem.

Read the Last-Modified reference

Cache key

Vary

Tells caches which request headers must differ before a separate cached response is required, such as content negotiated by Accept-Encoding or language.

Read the Vary reference

Want to go deeper?

If you would like to read more about Caching Headers, check out the Knowledge Base for detailed references, configuration guidance, cache troubleshooting, and server-specific examples.

Browse Knowledge Base

Copyright ©2026 MILAN INNOVATIONS LLC. All rights reserved.