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 Order and priority: A Guide for Website Owners

Learn how Cloudflare applies multiple Cache Rules, when later rules override earlier ones, and how to place URL exceptions.

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.

If multiple Cloudflare Cache Rules match the same request, the last matching rule controls any setting those rules set differently. Put broad caching rules first and narrower exceptions later; for example, a later bypass-cache rule can override an earlier caching rule.

How Cache Rule order works#

Cloudflare allows multiple Cache Rules to apply to one request. When matching rules set the same or conflicting setting, the later matching rule wins. This means a broad rule can establish the default behavior, while a later rule can change that behavior for a specific URL pattern.

For a simple example:

  1. An earlier rule enables caching for a broad group of requests.
  2. A later rule matches a more specific path and sets the request to bypass cache.
  3. The later bypass-cache setting controls the request because it is the last matching rule for that setting.

This order applies to the documented Cloudflare Cache Rules behavior. It should not be treated as a universal rule for every hosting provider.

Where Cache Rules fit in Cloudflare’s rule processing#

Cloudflare documents a broader Rules execution order. Cache Rules run after Request Header Transform Rules and before Snippets and Cloud Connector.

For non-terminating rule actions, later changes in the same phase can overwrite earlier ones. A terminating action stops evaluation immediately, so later rules are not evaluated for that request.

Cache Rules versus other cache settings#

Cloudflare states that Cache Rules take precedence over caching Page Rules on the same path. A matching Cache Rule can also override a website-wide cache setting for that request. When investigating an unexpected result, review the matching Cache Rules first, then check applicable Page Rules and the broader website-wide setting.

A practical review checklist#

  • List every Cache Rule that can match the URL.
  • Read the rules in their actual evaluation order, from earlier to later.
  • Place broad default rules before narrower exceptions.
  • Check whether a later rule changes caching, bypasses cache, or sets another conflicting value.
  • Review caching Page Rules for the same path because Cache Rules take precedence there.
  • Check whether a website-wide cache setting is being overridden by a matching Cache Rule.
  • Determine whether any terminating action stops evaluation before later rules run.
  • Test the specific URL after reviewing the configuration; the documented precedence explains how Cloudflare resolves matches, while a test confirms the result for your current rules and request conditions.

Sources

  1. Cloudflare: Order and priority Checked 2026-11-23
  2. Cloudflare cache documentation Checked 2026-11-23