How do I exclude a specific URL from Cloudflare's caching?

You can exclude certain urls from Cloudflare's caching by using a feature called Page Rules. You can get to Page Rules by going to: settings->Page Rules.

The first step to using Page Rules is to define a pattern that defines when the rule is triggered. These patterns can be simple, such as a single URL, or complicated including multiple wildcards. Imagine you have a content management system with a single administrative URL:

If you want Cloudflare's performance and caching options off for this URL, then you would turn off the options using the drop down menus or toggles for the various Cloudflare features.

Wildcard and Advanced Pattern Matching

The pattern above will only match the following URL:

It will not match any of the following URLs:  [http ≠ https]  [missing www subdomain]  [admin ≠ admin.php]

You can make rules more flexible by including wildcards with the * character. For example, if you wanted the pattern to match all four of the above URLs, you could use a pattern like:


A wildcard can represent zero or more characters and can be used anywhere in the pattern. So, for example, the following pattern:*b*/*

Would match:

But would not match:  [missing the trailing slash]  [sam doesn't contain a "b"]

Please note: Page Rules are applied in the order that they are listed. If you want to change the position of a Page Rule, you can drag it up or down using the icon on the left hand side.

For a full Page Rule tutorial, visit this article.

Still not finding what you need?

The Cloudflare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk