SEO glossary

What is Cache-Control?

Learn what the Cache-Control HTTP header does—directives like max-age, no-store, and immutable—and how to configure caching for HTML, assets, and crawlers without stale SEO metadata.

Technical SEOUpdated August 14, 2026
Also known ascache control headerHTTP cache directivescaching headers

Definition

Cache-Control is an HTTP response header carrying directives that tell browsers, CDNs, and other caches whether to store a response, for how long, and whether revalidation is required before reuse.

Cache-Control: the instruction manual for every cache

The Cache-Control HTTP response header is how servers tell browsers, CDNs, and reverse proxies what they may do with a downloaded file. Without it, caches guess—and SEO suffers when guesses mean week-old canonical tags, stale Open Graph images, or fresh users downloading ancient JavaScript because nothing was marked immutable.

Cache-Control is directive syntax—not a single TTL number. Values like public, max-age=3600, no-cache, and stale-while-revalidate=60 combine into policies per resource type. Getting HTML and hashed assets right is core Technical SEO operations work alongside compression and browser caching strategy.

Directive reference (SEO-oriented)

DirectiveMeaningTypical SEO use
max-age=NFresh for N seconds in browserShort for HTML; long for hashed JS
s-maxage=NFresh for N seconds on shared CDNEdge cache HTML 60s; origin still authoritative
publicAny cache may storeStatic assets, public HTML
privateOnly browser, not CDNPersonalized pages (often + noindex)
no-cacheStore but must revalidate before useDynamic HTML you want always checked
no-storeDo not store at allCheckout, account settings
immutableNo revalidation during max-ageapp.[hash].js for one year
must-revalidateOnce stale, must not serve without checkAPIs with ETags
stale-while-revalidate=NServe stale up to N sec while refreshingPerformance polish at CDN

Directives combine comma-separated:

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

Recipes by resource type

Fingerprinted JavaScript and CSS

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

Safe because filename changes on every content change. Pair with Brotli/Gzip and Vary: Accept-Encoding.

HTML documents (SSR marketing pages)

Cache-Control: public, max-age=0, must-revalidate

Or equivalently for many stacks:

Cache-Control: no-cache

Forces validation so deploys propagate titles and canonicals quickly to crawlers.

CDN-cached HTML with short edge TTL

Cache-Control: public, max-age=60, s-maxage=300, stale-while-revalidate=60

Users get fast edge responses; origin updates within minutes. Purge on urgent meta fixes.

XML sitemaps

Cache-Control: public, max-age=3600

Hourly freshness is usually enough; gzip/br compress well (compression).

Authenticated app responses

Cache-Control: private, no-store

Plus X-Robots-Tag: noindex where appropriate—cache and indexation aligned.

max-age vs s-maxage: who obeys what

Browser respects: max-age (falls back to Expires if absent)
CDN respects: s-maxage if present, else max-age

Example split:

Cache-Control: public, max-age=60, s-maxage=600

Browser revalidates every minute; CDN serves same object up to 10 minutes—reducing origin load for global edge rendering setups without locking browsers into decade-long HTML.

no-cache vs no-store (critical distinction)

no-cache sounds like “don’t cache” but means “cache, then validate.” Browsers store the response; before reuse they send If-None-Match or If-Modified-Since. Good for HTML where you want 304 efficiency with freshness checks.

no-store means never write to disk—mandatory for sensitive payloads. Overuse on public static assets wastes bandwidth.

immutable and SEO deploy safety

immutable prevents revalidation churn on reload for hashed files:

GET /assets/main.a1b2c3.js
Cache-Control: public, max-age=31536000, immutable

Never apply immutable to:

  • / homepage HTML
  • /product/shoe-42 without surrogate key purging
  • JSON-LD-only updates without HTML change

ETag and Last-Modified companions

Cache-Control defines freshness window; validators enable cheap revalidation:

HTTP/1.1 304 Not Modified
ETag: "a1b2c3"
Cache-Control: no-cache

Crawler fetches confirm whether indexed canonical still matches live server—if your CDN strips ETags, rely on short max-age instead.

Vary header interaction

When compression serves both br and gzip:

Vary: Accept-Encoding
Cache-Control: public, max-age=31536000, immutable

Without Vary, caches serve br-encoded body to gzip-only clients—broken scripts and render failures (JavaScript rendering risk).

Avoid Vary: User-Agent unless necessary—multiplies cache cardinality and can cause mobile/desktop HTML divergence under mobile-first indexing.

Cache-Control mistakes that hurt SEO

MisconfigurationSEO consequence
max-age=31536000 on /index.htmlStale titles in index after rebrand
Missing purge on CDN after robots.txt changeCrawlers see old disallow rules
public on Set-Cookie responsesCached personalized HTML leaked
No Cache-Control on large JSHeuristic caching unpredictability
stale-while-revalidate too long on PDP HTMLOut-of-stock items remain indexable

Testing Cache-Control in production

curl -sI https://example.com/ | grep -i cache-control
curl -sI https://cdn.example.com/app.a1b2c3.js | grep -i cache-control

Chrome DevTools → Network → select asset → Headers tab.

CDN dashboards show cache HIT/MISS—correlate with s-maxage.

Cache-Control for crawlers specifically

Googlebot honors caching but recrawls important URLs based on signals. Do not use long HTML max-age as a substitute for Last-Modified truth. After migration, shorten HTML TTL temporarily, request indexing in Search Console, and verify URL Inspection shows the new canonical.

How Crawlox helps with Cache-Control validation

Crawlox records response headers during crawls—including Cache-Control when present—helping teams spot HTML documents cached too aggressively at origin or CDN. If crawl snapshots show meta tags lagging known deploys, tighten HTML directives before Search Console index coverage reflects outdated snippets across thousands of URLs.

Related terms

Frequently asked questions

What Cache-Control should HTML pages use?

Often no-cache (must revalidate) or short max-age (60–300s) with CDN s-maxage. Avoid long immutable HTML—it delays title and canonical updates reaching crawlers.

What does max-age=31536000 mean?

Browsers may treat the response as fresh for one year (31,536,000 seconds) without contacting the server—appropriate only for fingerprinted static assets.

What is the difference between no-cache and no-store?

no-cache allows storage but requires validation before reuse. no-store forbids storing the response anywhere—use for sensitive personalized data.

What is s-maxage?

Shared max-age for CDNs and proxies only; browsers use max-age. Lets you cache longer at edge than on client devices.

Does Cache-Control affect Googlebot?

Googlebot respects HTTP caching semantics. Long-lived HTML cache can slow visibility of updated meta tags; asset caching is fine with hashed filenames.

References

Explore authoritative guidance and frameworks related to cache-control.

Explore every glossary definition

Return to the glossary to search by term, alias, starting letter, or category.

Browse glossary