Cloudflare Page Rules: Recommendations
I have created this article as I have been exploring Cloudflare page rules for my website so I thought I would advise users on the best rules that I would recommend for use with Cloudflare and WordPress.
You can find the different features of the Cloudflare plans here. I’d recommend using the free plan for any WordPress website as it brings many enhancements to every site, such as page performance improvements and added layers of security.
Now on to the page rules, there is many reasons why you would want to implement page rules such the following:
- Redirecting http to https
- Forwarding domains and sub-domains to your primary site. For example I forward https://gardiner-moon.co.uk to https://jacob.gardiner-moon.co.uk
- Increasing security on WP-Admin for WordPress sites.
- Increasing cache level for pages that do not change often such as Terms of Service and Privacy Policy pages.
FREE PLAN:
You will need to replace the URL to reflect your site.
URL: https://jacob.gardiner-moon.co.uk/*
Browser Integrity Check – On
Server Sides Excludes – On
SSL – Full
Rocket Loader – Automatic
Browser Cache TTL – 8 Days
Always Online – On
Security Level – Medium
Cache Level – Cache Everything
Edge Cache TTL – 1 Day
Email Obfuscation – On
Web Application Firewall – On
URL: https://jacob.gardiner-moon.co.uk/wp-admin*
Security Level – High
Cache Level – Bypass
URL: https://jacob.gardiner-moon.co.uk/*preview=true*
Cache Level – Bypass
Page Forwarding Rule:
I’d always advise using a 301 – Permanent Redirect as this is the best method for forwarding URL’s while also improving SEO ranking. There may be other cases that you could use a 302 – Temporary Redirect If you were planning on only redirecting this URL for a specified period of time.
PRO PLAN:
URL: https://jacob.gardiner-moon.co.uk/*
Browser Integrity Check – On
Server Sides Excludes – On
SSL – Full
Polish (Pro Subscription) – Lossy
Rocket Loader – Automatic
Browser Cache TTL – 8 Days
Mirage – On
Always Online – On
Security Level – Medium
Cache Level – Cache Everything
Edge Cache TTL – 1 Day
Email Obfuscation – On
Results:
Hopefully these rules will be able to help you achieve better performance on your WordPress site! These made a significant improvement according to Speed Tests that I performed using my hosting provider:
Before: