Cloudflare needs a couple of special setup tweaks to work with WordPress
Almost all bloggers who use WordPress know that a fast and secure website is critical. The first step is to use a reliable and fast hosting provider.
I know that many authors are now using WordPress to aid in book promotion, and with book covers images being resource hungry along with some social media and auto-posting plugins, speed should be a priority.
The best three ways to reduce loading times for a WordPress site are:
- Use a caching plugin
- Use CDN services
There are thousands of articles, reviews and opinions online regarding the choices of these three key speed elements, so I won’t go into any depth here in this article. I will focus mainly on getting WordPress to run smoothly and fast on Cloudflare.
However, before I go on to setting up Cloudflare for WordPress, I should preface my advice by indicating what speed tools I am currently using on my site.
- For caching, I use W3 Total Cache for browser and page caching.
Both are the free versions available form the WordPress plugin repository and work superbly together.
It is possible to minify with W3 Total Cache and it works perfectly. But I find that Autoptimize is a little better because I don’t have to make any setting adjustments when I add or delete plugins.
While these two plugins alone reduce page loading times extremely well and often result in near 100% results on some speed test sites, there remains a problem of distance.
My site server is in Geneva in Switzerland and it is very fast and reliable, especially for site visitors from Europe.
But for say, US visitors, there is a long distance for the site data to travel. This results in slightly slower page loading times in Canada, South Africa and Australia for instance.
Using a CDN service solves the distance problem.
Cloudflare is well known as a reliable CDN (Content Delivery Network) provider that is used by bloggers and enterprise clients. Cloudflare support is good, but 95% of questions can be answered from its knowledge base.
In brief, once you change your ip address, CDN stores your static files on local servers, which are then delivered much faster to site visitors in any location, because approximately 80% of any one of your web pages consists of static data. However, it does not store static html by default.
There are many choices of CDN providers, but Cloudflare has three huge advantages.
- One: The network is worldwide.
- Two: It can protect against hackers.
- Three: It is free.
For these reasons, it is the logical first choice for bloggers wanting to use a CDN to improve their site performance.
Setting up a WordPress site on Cloudflare is a straightforward process and there are a lot of in-depth articles explaining the process. Here is one article example explaining the basic Cloudflare setup steps.
The only tip I would add is that the Cloudflare plugin is not necessary because it is just as easy to complete the setup steps from the Cloudflare desktop page. But the choice is up to you.
Great! Now you have a very fast site for your worldwide visitors.
After setting up your CDN your site more secure and faster loading.
When you check your site and run a few speed tests with Google PageSpeed, GTmetrix or Pingdom, you will see how fast your site is after deploying a CDN.
Everything is working, your site is lightning fast, you are pleased, so all is great with the world.
Except! What’s happening to my WordPress editor?
When you go to admin pages, little problems may start to appear.
Issues such as slow loading, or worse, a white page.
After a few days, the problems can often tend to get worse.
I nearly tore my hair out trying to resolve these annoying issues. Normally it is only a matter of searching on Google to find a WordPress fix, but this one eluded me for weeks.
In the end, the solution came from two pieces of information that I glued together after my frustrating hunt through probably hundreds of advice articles.
How to get WordPress admin pages to behave with Cloudflare.
There are two simple steps involved in solving your WordPress admin page problems on Cloudflare.
First, and most importantly, you have to change one cache setting in Cloudflare.
This is where all the admin page problems start from because you need to use your WordPress cache settings and not Cloudflare’s.
The default settings are for a couple of hours of caching, which is why the admin pages lag so badly. To fix this is easy.
Click on the Caching tab in Cloudflare.
Then change the Browser Cache Expiration setting to Respect Existing Headers.
Your cache is now working happily between WordPress and Cloudflare.
Next is to fine tune your admin page performance.
Now go to Page Rules to set up your page rules.
You will need to add three rules. As you only get three rules with the free Cloudflare, it is important to use them wisely.
Add your first rule for your wp-admin pages. You can copy the rule below but edit it to your own site URL.
Then add two settings. Cache Level and Disable Performance.
You can set the cache to Bypass on all of the three rules if you wish but there are some files that standard caching helps load a little faster.
The second rule is to stop any interference with your draft preview function.
Lastly is to make sure Cloudflare doesn’t affect your login.
Now you need to set the order of your rules to make sure they load in the correct order.
To set the order, pull up or down using the arrows on the left of the rule box.
That’s all you need to do.
Now you will have all your backend WordPress admin pages behaving perfectly again.
Using a CDN is well worth considering for any WordPress site.
Not only for extra site security and to reduce page loading times, but also to ensure that your site visitors have a positive experience when they visit your site.
Google has made it clear that it prefers fast loading websites and has made page speed a strong ranking factor. So this is another very important reason to think about upgrading your site with a CDN.
Maintaining your blog and ensuring it is working for you is always work in progress. So keep looking for small improvements you can make to your blog to increase your visitor satisfaction and return rate.