Knowledgebase

Page Rules and Cache Rules Print

  • cloudflarecdn, cloudflare, caching, security, redirects, woocommerce, ssl, performance
  • 0

Configuring behaviour per URL.

WHAT THEY DO

Apply settings to URLs matching a pattern: caching behaviour, security level, SSL, redirects.

WHAT PEOPLE USE THEM FOR

Bypassing cache for admin and checkout paths Caching HTML for specific sections Bypassing security for a validation path Redirecting one URL to another Disabling optimisation features for a path that breaks

THE ORDER MATTERS

Rules are evaluated in order, and the first match applies. Specific rules must come above general ones.

A general rule at the top prevents everything below it applying.

THE FREE PLAN LIMIT

A small number of page rules. Use them for what matters most.

Cloudflare's newer cache rules and redirect rules have separate allowances and are worth using instead where available.

THE RULES MOST SITES NEED

Bypass cache for the admin path Bypass cache for cart, checkout and account, on a shop Bypass security for anything that legitimately makes many requests

TESTING

After creating a rule, test the matching URL and a non-matching one. Patterns are easy to get slightly wrong.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot