DELAPARRA
Index
Color
NL
Category: HTTP headers

Cache-Control

Explained by Updated

What is Cache-Control?

Cache-Control: The dominant caching directive. Controls how/whether responses are cached by browsers, CDNs, and proxies. Cache-Control tells browsers, CDNs and proxies whether and how long they may store a response. max-age=3600 means one hour. no-store means do not keep it at all. public and private decide whether shared caches may store it.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Cache-Control

How is Cache-Control used in practice?

For static assets with a version in the file name, such as app-3f9a2c.js, use public, max-age=31536000, immutable. The file never changes under that name, so browsers can keep it for a year.

What should you keep in mind with Cache-Control?

HTML pages need shorter lifetimes, or no-cache with revalidation, so visitors see updates quickly. Pages that show personal data should be private or no-store, so a shared cache never serves one user's account page to another. Getting these headers right is one of the cheapest performance improvements a site can make.

What does an example of Cache-Control look like?

Cache-Control: public, max-age=31536000, immutable

At a glance

CategoryHTTP headers
Explained by
Updated

More HTTP headers terms

All terms starting with C

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.