Skip to content

Instantly share code, notes, and snippets.

@jessuppi
Created June 13, 2026 06:38
Show Gist options
  • Select an option

  • Save jessuppi/8ff253c9ebfccfea00fce29cfbb22e45 to your computer and use it in GitHub Desktop.

Select an option

Save jessuppi/8ff253c9ebfccfea00fce29cfbb22e45 to your computer and use it in GitHub Desktop.
Cloudflare "Cache Everything" Rule For WordPress Multisite
If incoming requests match...
> Custom filter expression
When incoming requests match...
> Edit expression
(
http.request.method in {"GET" "HEAD"}
and not http.request.uri.path wildcard "/cdn-cgi/*"
and not http.request.uri.path wildcard "/wp-admin*"
and not http.request.uri.path wildcard "/wp-login.php*"
and not http.request.uri.path wildcard "/wp-json*"
and not http.request.uri.path wildcard "/wp-signup.php*"
and not http.request.uri.path wildcard "/wp-activate.php*"
and not http.request.uri.query contains "preview"
and not http.request.uri.query contains "wp_customize"
and not http.request.uri.query contains "customize_changeset_uuid"
and not http.cookie contains "wordpress_logged_in_"
and not http.cookie contains "wordpress_sec_"
and not http.cookie contains "wp-postpass_"
and not http.cookie contains "comment_author_"
)
Then...
Cache eligibility
> Eligible for cache
Edge TTL
> Ignore cache-control header and use this TTL
Input time-to-live (TTL)
> 2 hours
Status code TTL
> None (or)
> Greater than or equal - 500 - No store
Browser TTL
> Bypass cache
Cache key
> None
Cache deception armor
> Enabled
Serve stale content while revalidating
> Do not serve stale content while updating (disabled)
Respect strong ETags
> Use strong ETag headers (disabled)
Origin error page pass-through
> Use Origin error page pass-thru (disabled)
Place at
Select order
> First
@jessuppi

Copy link
Copy Markdown
Author

Here's another rule for WordPress single site installations:

https://gist.github.com/jessuppi/4a8334d777621867f08c24f77c0857fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment