---
title: "What is s-maxage? Separate TTLs for CDNs and browsers — warmup.rocks Glossary"
description: "s-maxage sets the cache lifetime for shared caches like CDNs, separately from the browser's max-age. Why you usually want a long s-maxage and a short max-age, and how CDN-specific headers fit in."
canonical: https://warmup.rocks/glossary/s-maxage
---

# s-maxage

**s-maxage** is a [Cache-Control](https://warmup.rocks/glossary/cache-control) directive that sets the freshness lifetime for _shared_ caches — CDNs and proxies — separately from the browser. Where both are present, shared caches follow `s-maxage` and ignore `max-age`; browsers never look at `s-maxage`.

## Why two lifetimes?

Because you can purge a CDN, but you can't purge your visitors' browsers. That asymmetry makes different TTLs the right default:

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

Browsers re-check after a minute — so a correction you publish reaches returning visitors quickly. The CDN keeps the copy for a day, giving you a high [hit ratio](https://warmup.rocks/glossary/cache-hit-ratio); when content changes you [purge](https://warmup.rocks/glossary/cache-purge) and re-warm, and the long edge TTL costs you nothing in staleness.

## CDN-specific variants

Several CDNs add headers that control _only their own_ cache and are stripped before the response goes out:

-   `CDN-Cache-Control` — the standardized variant (RFC 9213), respected by Cloudflare and others.
-   `Cloudflare-CDN-Cache-Control` — Cloudflare only; wins over `CDN-Cache-Control` and `s-maxage` there.
-   `Surrogate-Control` — Fastly's traditional equivalent.

Precedence (most specific wins): vendor header → `CDN-Cache-Control` → `s-maxage` → `max-age`. If a cached response seems to ignore your `s-maxage`, check whether a CDN rule (e.g. Cloudflare "Edge Cache TTL") overrides headers entirely.

## The catch

`s-maxage` is a ceiling, not a guarantee: under cache pressure a CDN may [evict your object long before it expires](https://warmup.rocks/glossary/cache-eviction) — in our own measurements, some edge locations lost up to 9% of warmed objects between hourly passes. A long `s-maxage` plus scheduled re-warming is what actually keeps the edge hot. Verify per location with the [cache checker](https://warmup.rocks/cache-checker).
