We are a nonprofit organization and we have 50+ various types of websites in our Cloudflare account (most of which are WordPress). We recently discovered information through the following Cloudflare forum topic and help articles about using page rules on our sites to cache everything to speed up our sites as well as reduce our server load:
- Caching everything
- Understanding and Configuring Cloudflare Page Rules (Page Rules Tutorial)
- Best Practices: Speed up your Site with Custom Caching via Cloudflare Page Rules
Again, since we’re a nonprofit, we don’t have the money to spend on buying extra page rules or paying for the Cloudflare Pro plan for every site. However, we really want to take advantage of what Cloudflare has to offer with page rules, primarily with our WordPress sites, while our websites are each on the Free plan.
Until now we’ve only been using the following page rules for our WordPress sites:
*example.com/wp-login*: Browser Integrity Check: On, Security Level: High, Cache Level: Bypass, Disable Performance
*example.com/wp-admin/*: Browser Integrity Check: On, Security Level: High, Cache Level: Bypass, Disable Performance
With this new fuller Cloudflare caching discovery we want to add the following new page rule on as many of our WordPress sites as we can:
*example.com/*: Cache Level: Cache Everything, Edge Cache TTL: a month
However, even though many of these WordPress sites are quite static with their content, they all usually have at least one dynamic area/page (e.g., contact form or blog posts with a comment area enabled), which doesn’t work so well or at all with the caching everything page rule. Ideally, if we had at least one more page rule, we could exclude the dynamic area/page from that level/type of caching. So we’ve been thinking that there might be a way to combine our two original page rules, since they have the same settings, to free up a page rule for us to use. The main idea we’ve had so far is to try the following URL match to combine those page rules, which should catch
This seemed like a great idea, but when I checked out the page source of one of our simplest sites for example and did some regex searching of the code, I noticed that various items from within the /wp-content/ and /wp-includes/ directories (as well as apparently /wp-json/) get caught with that URL match. For example:
<a href="https://example-other.com" target="_blank" rel="noopener"><img style="text-align: center; width: 100%; max-width: 665px; background-color: #e1f3ff;" src="/wp-content/uploads/mmt-banner-logo.png" alt="Mystical Mind Training Logo"></a><p style="margin: 0px; text-align: center;"></p>
<link rel='stylesheet' id='twenty-twenty-one-print-style-css' href='https://example.com/wp-content/themes/twentytwentyone/assets/css/print.css?ver=5.7.1' media='print' />
<link rel='stylesheet' id='wp-block-library-css' href='https://example.com/wp-includes/css/dist/block-library/style.min.css?ver=5.7.1' media='all' />
<script src='https://example.com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1' id='jquery-core-js'></script>
<script src='https://example.com/wp-includes/js/jquery/ui/core.min.js?ver=1.12.1' id='jquery-ui-core-js'></script>
So we wanted to ask about all of this here and see if it is important or not that some of these files/items are getting caught with that URL match? Does it seem like if these types of files/items, getting excluded from the cache everything page rule, would make a difference, or at least a significant difference, in page load speed and server load?
Any advice or information is greatly appreciated. Thank you.