max-age=N
- What it means (per MDN)
- The response stays fresh until N seconds after it was generated on the origin
- Typical use
- Versioned static files
Cache-Control is the HTTP header that tells browsers and CDNs how to store a response. See each directive, values for assets and HTML, and what Googlebot honors.
Cache-Control is an HTTP header that holds directives controlling how browsers and shared caches such as proxies and CDNs store and reuse a response. The two you will use most are max-age, which sets how many seconds a response stays fresh, and no-store, which tells caches not to keep it at all.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
A private cache is the one in the visitor's browser. A shared cache sits between your server and many visitors, such as a CDN. MDN warns that a shared cache stores one response and reuses it for multiple users, so personalized content must not end up there.
max-age=Ns-maxage=Nmax-age there and is ignored by private cachesno-cacheno-storeprivatepublicAuthorization headerimmutablemax-agestale-while-revalidate=NCache-Control: public, max-age=31536000, immutablemax-age=31536000 for URLs whose contents never change. A new version gets a new URLCache-Control: no-cache plus an ETagCache-Control: private or no-storeprivate can leak personal information via a shared cacheCache-Control: no-storeThe reason versioned URLs work: web.dev points out that you can't tell browsers to drop a stale cached copy of a file you told them to keep for a year. Changing the URL, usually by embedding a fingerprint in the filename, forces a fresh download.
ETag with If-None-Match, and Last-Modified with If-Modified-Since. It states: "Other HTTP caching directives aren't supported." Google's crawlers therefore do not support directives such as no-store or s-maxage, though they still affect browsers and CDNs.ETag and Last-Modified are present, Google's crawlers use the ETag, and Google recommends it because it has no date formatting issues.Last-Modified date must follow the HTTP date format, for example "Fri, 4 Sep 1998 19:15:56 GMT".max-age to the number of seconds content is expected to stay unchanged can help crawlers decide when to recrawl a URL.Conditional requests with ETag and If-None-Match are the part Google supports. For large sites where crawl budget matters, set ETag correctly, consider a max-age that matches how long the content stays unchanged, and leave the rest of your Cache-Control tuning to browsers and your CDN.
Look at one HTML URL and one fingerprinted asset. An Age header means a cache between you and the origin served the response, and a CDN setting can add or override Cache-Control, so test the public URL, not the origin.
curl -sI https://example.com/ | grep -i -E "cache-control|etag|last-modified|age|expires"
curl -sI https://example.com/assets/app.3f9c1b.js | grep -i -E "cache-control|etag|age"4 questions people ask next, answered from the sources on this page.
no-cache lets caches store the response but forces them to validate it with the origin before reuse. no-store tells caches of any kind not to store it. Use no-store when the content must not be kept.
For files whose URLs change when their content changes, web.dev recommends max-age=31536000, which is one year. For HTML and unversioned URLs, web.dev suggests no-cache with an ETag so the browser revalidates.
Only partly. Google says its crawlers support ETag and Last-Modified for caching, and that other HTTP caching directives aren't supported. It also says setting max-age, while not required, can help crawlers decide when to recrawl a URL.
Run curl -I against the URL, or open your browser's DevTools, choose the Network tab, click the request and read the response headers.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.