Advertising disclosure: We may earn a commission from links on this site. Commercial relationships can affect placement. Product facts, limitations, and source dates remain part of our editorial record.

How funding works
Web Hosting

Cloudflare Cache TTL by status code: A Guide for Website Owners

Learn how Cloudflare Cache Rules use status-code ranges, Cache-Control, and Edge TTL, including what to review before using the documented one-day example.

Review sources
Research standard

Facts that can change should include a source and check date. Benchmark claims should state the plan, region, method, and test period.

What “cache TTL by status code” means#

Cache TTL by status code is a Cloudflare Cache Rules setting that controls how matching responses are cached at the edge according to their HTTP status code. In Cloudflare’s documented example, a rule for a hostname containing example.com makes matching responses eligible for caching, uses the Cache-Control header when present, otherwise follows Cloudflare’s default caching behavior, matches status codes 200 through 599, and sets an Edge TTL of one day. The one-day duration is an example, not a universal recommendation.

Cloudflare describes caching as storing copies of frequently requested content at distributed data centers. Cache Rules let website owners identify which resources can be cached and specify how long they should remain cached. See Cloudflare’s cache documentation.

The documented Cache Rule example#

Data table from this page
SettingDocumented example
Match conditionA hostname containing example.com
Cache eligibilityMatching responses are eligible for caching
Cache-Control behaviorUse Cache-Control when present; otherwise use Cloudflare’s default caching behavior
Status-code range200 through 599
Edge TTLOne day

The example uses one status-code range and one Edge TTL. It does not provide a separate duration for each individual status code. Because the range covers both ordinary success responses and error status codes, review whether all responses in that range should be eligible for the same rule.

How to review the rule before using it#

  1. Confirm the match condition identifies the hostname and responses you intend to control. The documentation uses a hostname containing example.com as its example.
  2. Confirm that matching responses should be eligible for caching.
  3. Check the status-code range. The documented range is 200 through 599; do not treat that range as a requirement for every site.
  4. Review the Cache-Control behavior. In the example, Cloudflare uses Cache-Control when it is present and otherwise uses its default caching behavior.
  5. Choose the Edge TTL based on how long the selected responses may remain cached for your site. One day is the value shown in Cloudflare’s example, not a prescribed setting.

For the vendor-specific workflow and current field names, follow Cloudflare’s Cache TTL by status code example.

Sources

  1. Cloudflare: Cache TTL by status code Checked 2026-11-19
  2. Cloudflare cache documentation Checked 2026-11-19