Cloudflare Retention vs Freshness (TTL): A Guide for Website Owners
Understand how Cloudflare separates cache retention from freshness (TTL), what happens after expiry, and how website owners can request newer content.
Facts that can change should include a source and check date. Benchmark claims should state the plan, region, method, and test period.
If you manage a website using Cloudflare and an updated page still seems cached after its TTL expires, the reason is that retention and freshness are different. Retention is how long an object stays stored in Cloudflare's cache; freshness (TTL) is how long Cloudflare can use that object without checking the origin server, where the current content comes from. For Cloudflare, expiry leads to revalidation rather than automatic deletion.
Retention and freshness answer different questions#
| Concept | Question it answers | Cloudflare's documented behavior |
|---|---|---|
| Retention | How long does the object stay stored? | Eviction depends on relative popularity and cache size. Cloudflare uses a least-recently-used approach, and retention is not configurable. |
| Freshness (TTL) | How long can Cloudflare use the object without checking the origin? | When the TTL expires, Cloudflare revalidates the object. |
An object can remain retained in the cache after it is no longer fresh. A TTL is therefore not a promise that the object will be deleted when the TTL ends.
What happens after the TTL expires#
During revalidation, Cloudflare can confirm that the cached version is still valid or replace it with a newer version from the origin. If the content has not changed, the cached copy can continue to be used after validation.
With stale-while-revalidate, Cloudflare can revalidate in the background while continuing to serve the cached copy. This means a visitor may receive the retained version while Cloudflare checks whether a newer version is available.
Controls available to website owners#
For Cloudflare's CDN, website owners can influence freshness through:
Cache-Controlheaders sent by the origin server- Cloudflare Cache Rules
- Cloudflare Workers
These controls affect how long Cloudflare can use a response before checking the origin. They do not let you set the object's retention period; Cloudflare's eviction behavior is based on cache conditions and is not configurable.
If content must be updated before normal TTL revalidation, Cloudflare documents purging cached files to make it fetch newer versions. Use the control that matches the problem:
- Review the TTL policy when content is being checked too often or remains usable for longer than intended.
- Use the origin headers, Cache Rules, or Workers to adjust the freshness behavior for the relevant responses.
- Purge the cached files when a newer version needs to be fetched before the existing TTL cycle completes.
- Account for
stale-while-revalidateif the cached copy may continue to be served during a background check.
These retention, freshness, revalidation, and purge behaviors are specific to Cloudflare's documented system. Other hosting or CDN providers may define the terms and controls differently.
Sources
- Cloudflare: Retention vs Freshness (TTL) Checked 2026-09-29
- Cloudflare Cache documentation Checked 2026-09-29