Skip to content

Instantly share code, notes, and snippets.

@jessuppi
Last active June 19, 2026 09:35
Show Gist options
  • Select an option

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

Select an option

Save jessuppi/a311546d5334254bc50245b12d1b90c3 to your computer and use it in GitHub Desktop.
Cloudflare "Cache Assets" Rule For WordPress Websites
If incoming requests match...
> Custom filter expression
When incoming requests match...
> Edit expression
starts_with(http.request.uri.path, "/wp-content/") or starts_with(http.request.uri.path, "/wp-includes/")
Then...
Cache eligibility
> Eligible for cache
Edge TTL
> Ignore cache-control header and use this TTL
Input time-to-live (TTL)
> 1 month
Status code TTL
> None
Browser TTL
> Override origin and use this TTL
Input time-to-live (TTL) (required)
> 7 days
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
> Last
@jessuppi

Copy link
Copy Markdown
Author

Here's another rule for "Cache Everything" on WordPress sites:

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

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