CloudFlare Caching Rules for WordPress

Rule #1: Cache

FieldOperatorValue
Hostnameequalswww.yourdomainname.com
AND
Cookiedoes not containwordpress_logged_in
Expression preview: (http.host eq “www.yourdomainname.com” and not http.cookie contains “wordpress_logged_in”)

Then…

Cache eligibility: Eligible for cache
Edge TTL: Use cache-control header if present, use default Cloudflare caching behavior if not
Browser TTL: Override origin and use this TTL – 1 day
Sort query string: Yes
Serve stale content while revalidating: Yes
Use strong ETag headers: Yes

Rule #2: Admin No Cache

FieldOperatorValue
URI Pathstarts with/wp-admin/
OR
Cookiecontainswordpress_logged_in
Expression preview: (starts_with(http.request.uri.path, “/wp-admin/”)) or (http.cookie contains “wordpress_logged_in”)

Then…

Cache eligibility: Bypass cache


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.