Page Rules with Wordpress Multisite Subfolder setup

Hi,

I am posting this topic after having read lots of posts about cloudflare page rules in combination with wordpress, especially with cache everything, in this community and on the web in general, but not finding the answer I am looking for. I have discovered that a lot of info on the web is wrong (for example disregarding the order of page rules) or inefficient (for example using cache everything for wp-content) so I hope this community can provide me with accurate answers.

Some background info. I am using wordpress in a multisite installation with subfolders:

I do not have dynamic content (no shopping cart or specific content for logged in users), but I do have event-driven content (comments, donations, blog) so I need to keep wp-json and wp-admin from being cached.

I am trying to use my 3 free page rules as optimally as possible, including one for cache everything.

These are the page rules I am using now:

  1. buddho.nl/wp-*
    Browser Integrity Check: On, Security Level: High, Origin Cache Control: On
  2. buddho.nl/en/wp-*
    Browser Integrity Check: On, Security Level: High, Origin Cache Control: On
  3. buddho.nl/*
    Browser Cache TTL: 30 minutes, Cache Level: Cache Everything, Edge Cache TTL: 2 hours, Origin Cache Control: On

My first question concering using wildcard ‘’ in the url field:
could I use buddho.nl/wp- instead of needing an extra page rule for the subfolder (in other words, wil the first '
’ count as both ‘empty’ and ‘/en/’? This would free one url which I could then use for buddho.nl/= to keep the html from previews (‘preview=true’) and searches (‘s=’) from being cached by cache everything. Or does using ‘=’ have consequences I am not thinking about?

My second question conceirns edge cache TTL and browser cache TTL:
Can I set edge cache TTL to a month with event-driven content without running the risk of it not being updated (I am using WP-Rocket which should purge the cloudflare cache of necessary pages on new posts and comments)? And does the Browser Cache TTL override all cache headers in htacces or is just the ones lower thant the TTL specified (which in practice means html) even if I set origin cache control to on?

If you have any other suggestions I am open to all ideas. I would even consider buying additional page rules. Since our website runes on donations I don’t have the budget for higher coudflare plans.

Best,

Wouter

I jsut saw that some text in my previous post got reformatted ( * turned into em ), it should read:
My first question concering using wildcard * in the url field:
could I use buddho.nl/ * wp- * instead of needing an extra page rule for the subfolder (in other words, wil the first * count as both ‘empty’ and ‘/en/’?

(another addition to the first post in regard to event-driven content: I also have a contact form and mailchimp subscription form)

For the first question, it shouldn’t be too tough to test this on your own. I don’t have a similar setup, so I can’t check it, and have not attempted such a wildcard pattern.

Question 2: I’d go with the higher Edge Cache TTL since you can purge that cache manually, and it’s pretty fast. WPR should purge the cache automatically if it’s properly configured.

The last one: Docs support your understanding of Browser Cache TTL.

thanks for the reply. I have read the doc’s before. I am just a hobbyist, so not everything is directly clear to me.

Do I understand correctly that If I remove the browser cache TTL from the third rule the origin cache headers will be respected?

About the first question: When setting it to * wp- * and checking …/wp-admin.php and …/en/wp-admin.php it in pingdom both have a cf_cache_header that is set to dynamic. Am I correct in concluding that it does seem to work?

And do you have any experience with using [url}/ * = * as a rule to keep previews and search results from being cached by cache-everything?

Browser Cache TTL is 4 Hours by default in Cloudflare’s Cache settings page. If you remove browser cache from the rule, the default setting might kick in. There are so many cache settings in so many places, I’m never sure which will take precedence, so I do a lot of trial and error testing. You may have to change the default, or change that third rule to respect headers. Or maybe it’ll mysteriously work as you’re hoping.

Search should not be affected because the URL has a specific query string. Previews are always a pain, so I either put the site in Dev mode during editing, or preview once and hope it looks good. Otherwise I’d have to purge the cache.

thanks again for the reply. Using dev mode sounds like a good alternative when previewing. Meanwhile I am having issues with messages in the contact form not beging send (I get a succes message on my website, but they aren’t comin throught) so I deactivated cloudflare al together until I can figure out how to get it to work…