创建 CloudFlare 缓存规则(Caching Rules)

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

滚动至顶部
扫描微信二维码联系我们 关闭