You only get three free rules. How are you going to configure them to get the most out of them?
This is what worked best for me. Please share your own solutions.
Cloudflare is a Content Delivery Network or CDN. Instead of your server having to serve up every file with each new, non-cached browser request, the CDN sends it from it’s network instead. This saves a bitload of data and time. There are many available but free is hard to pass up when your a small player in a cutthroat internet. A big part of SEO also depends on speed, as in how fast your page gets loaded, and if your on a shared hosting service then you should consider using a CDN like Cloudflare, which will speed up the delivery of your static content in mind blowing ways.
In this guide, I’m focusing on a blog site configuration and no commerce involved. To be honest, I haven’t studied out a best use solution to WooCommerce over Cloudflare as yet, but these rules should work well in WooCommerce also.
Also, this isn’t a WordPress beginner article, but if your willing to try, and search out the details, you’ll figure it out. Always ask questions and ignore the pompous self appointed Internet Gods that tend to flame the little people. If I forgot to cover something here, tell me, or just ask questions in the comment section.
What needs to be in place to begin?
- Create a free Cloudflare account. (Signup)
- Add your domain to the account and change your name servers at your domain registrar to the ones Cloudflare lists in your setup dialog.
- Your site should use DNS from Cloudflare in orange proxy mode to avoid issues and be able to use page rules effectively. More so for the paid version that allows URL forwarding. See “Why isn’t a Page Rule working?
A few considerations
You’re allowed to have three page rules on each site that you have active with your free Cloudflare account. Cloudflare page rules allow wild cards, but do not allow regular expression, aka regex. The wildcard character is the * . You can only use 5 wildcards per page rule in the URL string. I will not go into explanations of rule features or settings. Please review the Cloudflare Tutorial for that information.
Rules for the WordPress Admin
Rule 1, is to turn off everything you can that interferes with the WordPress admin interface. It also adds an increased level of security to protect the most privileged part of your website. You could spell out admin if you like, it really won’t matter, but I’m lazy.
Rule 2, I use to allow editors to function properly and uses the same features as rule 1. Beaver Builder, Divi, WPBakery, CSS Hero, typically have an equal sign somewhere in the URL string. Because not every editor will have “wp-admin” in the URL string, it’s a good idea to have the security setting set to high as well.
The last rule for everything else
Rule 3, is going to use cache for everything that the first two rules don’t catch. This one can’t be first or it will mess with your ability to use the admin area and editors.
Some if you will have other needs. Mine are simple for technoogies.com. I found that the more I tried to use and control in the page rules, the more trouble it caused me. So, less is more.
- Understanding and Configuring Cloudflare Page Rules (Page Rules Tutorial)
- Using Wildcards in Page Rules (The ‘Forwarding URL’ setting is not available for the free page rules, but the other options are.)
- Caching Static HTML with WordPress/WooCommerce (This will NOT work with the freebie rules.)