Cloudflare Edge Cache TTL: A Guide for Website Owners
Learn how Cloudflare Edge Cache TTL controls how long matching content stays cached, how to set a one-day rule, and when to purge changed files.
Facts that can change should include a source and check date. Benchmark claims should state the plan, region, method, and test period.
What Edge Cache TTL does#
If you want Cloudflare to cache matching requests for a fixed period, create a Cache Rule that makes the requests eligible for caching and sets an Edge TTL. In Cloudflare’s documented example, the rule uses a one-day TTL and tells Cloudflare to ignore the origin’s Cache-Control header for those requests. Cloudflare then uses the rule’s one-day value for matching content.
Cloudflare’s cache stores copies of frequently accessed content at distributed data centers. Cache Rules let website owners define which resources are eligible for caching and how long they should remain cached.
Create the documented one-day rule#
In Cloudflare, create a Cache Rule with these settings:
- Add a hostname condition such as
Hostname contains "example.com". - Set Cache eligibility to Eligible for cache.
- Under Edge TTL, choose Ignore cache-control header and use this TTL.
- Enter 1 day as the TTL.
The hostname condition determines which requests the rule matches. The cache eligibility setting allows Cloudflare to store matching responses. The Edge TTL setting determines how long Cloudflare uses the cached copy instead of following the origin’s Cache-Control value.
What to do when content changes#
A one-day Edge TTL can leave an older cached copy in place after the content changes at your website’s server. Cloudflare’s cache documentation describes purging specific cached files or purging all cached files. After a purge, Cloudflare fetches fresh versions from the server.
Use a purge when a changed file needs to be refreshed before its Edge TTL expires. A purge of specific files limits the action to those files; a purge of all cached files affects the entire Cloudflare cache for the site.
Practical cautions#
This example is a Cloudflare Cache Rules configuration, not a universal setting for every hosting or caching provider. Because the rule is configured to ignore the origin’s cache-control header, apply it only to requests for which the one-day Cloudflare TTL is appropriate. Review which hostname requests the rule matches and purge changed files when the cached version must be replaced sooner.
Sources
- Cloudflare: Edge Cache TTL Checked 2026-11-21
- Cloudflare cache documentation Checked 2026-11-21