---
title: "What is TTL in caching? Time to live, explained — warmup.rocks Glossary"
description: "TTL is how long a cached object stays fresh. Where it comes from (Cache-Control, CDN edge rules), what happens at expiry, and why a long TTL doesn't guarantee your object survives that long."
canonical: https://warmup.rocks/glossary/ttl
---

# TTL (time to live)

**TTL** is how long a cached object counts as fresh. While the TTL runs, a cache answers from its copy without asking the origin; once it expires, the next request triggers a revalidation or a full refetch. In HTTP caching the TTL comes from [Cache-Control](https://warmup.rocks/glossary/cache-control) (`max-age` for everyone, [s-maxage](https://warmup.rocks/glossary/s-maxage) for CDNs), from CDN edge rules that override headers, or from CDN defaults when nothing is set.

## Where the number comes from (precedence)

1.  CDN rule / dashboard setting (e.g. "Edge Cache TTL") — beats headers where configured.
2.  Vendor cache headers (`Cloudflare-CDN-Cache-Control`, `Surrogate-Control`).
3.  `CDN-Cache-Control`, then `s-maxage`, then `max-age`, then `Expires`.
4.  CDN default heuristics — often surprisingly short for HTML, or no caching at all.

## What happens at expiry

Expiry doesn't delete the object — it marks it stale. What follows depends on configuration: a conditional revalidation via [ETag](https://warmup.rocks/glossary/etag) (cheap, but still an origin round trip), a full refetch, or — with [stale-while-revalidate](https://warmup.rocks/glossary/stale-while-revalidate) — an instant stale answer plus background refresh.

## TTL is a ceiling, not a promise

Two things end a cache entry's life early. A [purge](https://warmup.rocks/glossary/cache-purge) removes it deliberately. [Eviction](https://warmup.rocks/glossary/cache-eviction) removes it because the PoP needed the space — and it hits unevenly: [in our 408,000-request measurement](https://warmup.rocks/blog/cdn-cache-miss-data) some edge locations lost up to 9.4% of warmed objects between hourly passes despite generous TTLs, while others lost none. Which is why TTL strategy and [warming schedule](https://warmup.rocks/blog/what-is-cache-warming) belong together: the TTL sets the theoretical lifetime, warming restores the entries reality takes away. Check any URL's actual TTL headers and edge status with the [cache checker](https://warmup.rocks/cache-checker).
