Cloudflare Docs
Visit Cache on GitHub
Set theme to dark (⇧+D)

Order and priority

Cache rules affect requests differently from Page Rules. This is how they are applied:

  1. Cache Rules are stackable. This means that multiple matching rules can be combined and applied to the same request. For example, if multiple cache rules match the same URL, then the features set in those cache rules will all be applied in order. If several matching rules set a value for the same setting, the value in the last matching rule wins. For an example of a similar scenario where multiple rules match, refer to the Origin Rules FAQ.

  2. For conflicting settings (for example, bypass cache versus eligible for cache), the last matching rule wins. For example, if cache rule #1 is set to cache everything on and cache rule #2 is set to bypass cache on, then cache will be bypassed for all URLs that match, since rule #2 is the last matching rule.

  3. If you have Page Rules implemented for caching on the same path, Cache Rules will take precedence by design.

​​ Execution order of Rules products

The execution order of Rules products is the following:

The different types of rules listed above will take precedence over Page Rules. This means that Page Rules will be overridden if there is a match for both Page Rules and the Rules products listed above.