Using Cloudflare with Westhost WordPress sites
Using the Free version of Cloudflare provided by my hosting company (Westhost) dramatically improved the speed and reliability of the WordPress sites on my shared hosting plan.
I have five sites on Westhost’s preferred shared hosting. To be honest, that is pushing the envelope a bit. Cpanel was showing a lot of faults. Mainly CPU and Entry Processes. Right now, the sites are fairly low traffic. I’m trying to incubate them. I let the sites go dormant for a year and decided to try to get them back up to speed. As I worked with the first site, I realized it was responding like a drunken pig. (No offense meant to inebriated swine).
It was unfeasible switch to a VPN plan at this time both in terms of cost and the time involved in migrating. I was looking at Content Distribution Networks. We use a lot of AWS at work. That seemed like overkill. I started reading about Cloudflare.
I was getting ready to set the service up directly with Cloudflare when I noticed that Westhost offered it on their Chi dashboard. I decided to try one of the sites to see how much was involved in setting it up and if it really boosted performance.
Before you begin
Before you consider trying something like Cloudflare… BACK YOUR SITE UP in a way that you can recover if things go nasty. Another thing. BACK YOUR SITE UP.. And one final thing BACK THE STINKING SITE UP!!!
You can also do some benchmarks using tools that will show the page metrics such as Pingdom Tools. I printed the results to PDF files and saved them in a folder. That way, I can tell if there is a change in performance.
Also, look at your cpanel. The home page on cpanel shows usage. You can refresh that page to get a feel for the average load on your server. You can also take a look at the CPU and Concurrent Connection tool to get a baseline for how your hosting is responding.
Run a ping on your sites so you know what IP is associated with your current hosting company.
What you need:
- A working knowledge of, and access to your DNS records.
- A working knowledge of tools such as Ping, Traceroute and free proxies.
- FTP access to your site.
Prep your WordPress site
You need to examine your plugins and look for any plugins that might be re-writing your .htaccess files , doing any kind or redirection or forcing SSL.
Disable any plugins that meet the issues above. I disabled
- Force Https
- Supercache (This was critical)
- Geo/Country blockers. I disabled my country blocker temporarily until I can determine if blocking countries has any impact on the Cloudflare service.
- Note – it is easier to disable and re-enable than to try to fix a site whacked by a plugin that doesnt’ want to play nicely.
Add a plugin designed for Cloudflare. I added Cloudflare Flexible SSL (Assuming your site is using SSL which it should be).
Turn on Cloudflare in the control panel
In the CHI control panel, you go to Domains, then look for Cloudflare. You can set up one month or one year free (as of April 2019). Choose the one year plan.
You need to enable the WWW subdomain at least. I would suggest leaving the settings at the defaults until everything is stable.
Shorten the TTL
The TTLs are usually set to about 1 day. I found it helps to shorten the TTL (Time to live) for your domain’s A record and Cname – IOW, I set the A record for chrismendlatech.com and the cname record for www.chrismendlatech.com to one hour.
Check your site.
Keep a close eye on your site Make sure it is responding. DO NOT EXPECT AN IMMEDIATE CHANGE IN RESPONSE TIME. The site has to propagate through the Cloudflare system.
Is your site really on Cloudflare?
This is tricky because of DNS caching. It is tricky to determine if the site really has migrated. Here are some tools that will help you.
- Check the Cloudflare panel. That will at least tell you if Cloudflare is activated. It seems that the hits reported are NOT real time. I think they are updated daily. (I could be wrong)
- There is a plugin called Claire for Chrome. That will show you if a site you visit is using Cloudflare.
- Use the Ping command. If the site is being served from Cloudflare, you will see the IP change. HOWEVER, keep in mind that you might not see the change locally because of browser caching, machine dns caching and caching by your internet provider.
- Use an online ping service such as the Online Ping Utility. This will provide a more accurate ping than one from your local machine.
Give it a couple of days or a week. Then check your performance on the benchmarking sites you used at the beginning. Also, check your Google Analytics, error logs, Adsense and whatever other indicators you have. You should see a performance increase.
Activating Cloudflare really sped up my sites and reduced the number of CPU and Entry Process Faults. The setup was not that difficult.
- Opening multiple WordPress admin window for sites on a shared host results in high CPU usage.
- Website speed does matter – Speed up your Joomla Site
- WordPress Captcha plugin has a backdoor.
- Updating your WordPress plugins takes your site offline temporarily – Time things accordingly.
- WP Super Cache for WordPress was not working on a shared host.
- SOLVED – WPS Hide Admin not working after deploying HTTPS in WordPress
- Fixing the “Leverage browser caching” and “Enable Compression” from Google Page Speed in Joomla
- Is your site on HTTPs yet? Chrome will warn users who visit http sites.