Cache-Control
The HTTP header that tells browsers, apps and CDNs whether a response may be stored and how long it stays fresh.
Definition
max-age=N lets a cache reuse the response for N seconds without asking; no-cache allows storing but requires revalidation before every use; no-store forbids storing; private keeps it out of shared caches like CDNs; s-maxage sets a separate lifetime for shared caches; immutable says the content will never change. Without the header, caches may guess a lifetime from Last-Modified.
In practice
Cache-Control: public, max-age=31536000, immutable for /assets/app.8d2f1c.js; Cache-Control: no-store for a bank statement.
Learn it in context
Lessons that use this term.
Related terms
- ETagAn identifier for one version of a response, used to ask the server cheaply whether a cached copy is still current.
- CDN (content delivery network)Servers in many cities that keep copies of your files and answer users from nearby, fetching from your origin only on a miss.
- CachingKeeping a copy of data somewhere faster, so you don't fetch or compute it again every time.