Cache-Control
Cache-Control is an HTTP header that tells browsers and CDNs how to cache a response — for how long, and whether they may store it at all. Directives like max-age, public, private, no-cache, and immutable set freshness, control revalidation, and decide how aggressively an asset is reused.
The header is a comma-separated list of directives. max-age=31536000 says "this is fresh for a year." public lets shared caches like a CDN store it; private restricts it to the user's browser. no-cache means a cache may store the response but must revalidate before reuse, while no-store forbids caching entirely — useful for sensitive data.
The immutable directive is a performance gem for versioned assets. Combined with a fingerprinted filename (app.9f3c2.js), Cache-Control: public, max-age=31536000, immutable tells the browser it never even needs to revalidate — the URL changes whenever the content does.
Get this header right and your CDN serves the overwhelming majority of requests from the edge. Get it wrong — too short, or missing entirely — and every request falls through to origin, driving up latency and egress.
Cache-Control: public, max-age=31536000, immutable