A few months back (around September 2012), BlueHost and others started advertising–maybe even pushing–CloudFlare to its users. The promise was/is that CloudFlare will speed up your website using a content delivery network (CDN). They say it’s a relatively easy thing to set up and BlueHost even has an integrated piece to facilitate it smoothly from with their own control panel.
“I’m thinking of switching to Cloud Flare. Is this a good move or can this end up being a disaster? I’ve not read anything negative, but thought I’d better ask before moving forward.” – WordPress Experts group member
I read this question on the WordPress Experts LinkedIn group today and I thought I’d answer it with a real-life example because I’ve wondered the same thing.
Is it worth making the switch to CloudFlare?
It seems like this breaks down into two parts:
- Does it work? Does it actually make my site load faster for visitors?
- How long does it take to make the switch? Do things break along the way?
Test Site: Hawaii Picture of the Day
The data I’m using for this post comes from one of my pet projects–Hawaii Picture of the Day. It is a picture-heavy site where we put up a new picture of Hawaii from amateur or professional photographers every day. It is hosted at BlueHost using a shared server and the current version of WordPress with a custom theme, a dozen plugins all at current versions, two of which are caching and minimizing scripts.
Because it has so many pictures and because visitors come from across the globe–primarily North America and Japan–to access it, a free content delivery network sounded great. We signed up in early October and switched it over.
I decided the best comparison data available to me was for the 2 months prior to the switch and the 2 months after. So, everything in this post is looking at Google Analytics data comparing August – September to November – December of 2012.
For Hawaii Picture of the Day we believe a faster site means people will take the time to view more pictures and more pages. In turn, this means they will view more advertisements and therefore increase our chances of someone clicking on one, giving us a few cents. More page views also means increasing the chance that someone will find something they really like and will share it with others thereby giving us more visitors.
Did Switching to CloudFlare Make the Site Faster?
When looking at the site as a whole, the CloudFlare CDN loaded pages about 11% faster than my BlueHost only hosting. On the whole, all technical aspects were faster except for redirection time, which was 2.5 times slower.
|BlueHost: Aug 1 – Sep 30||CloudFlare: Nov 1 – Dec 31||Difference|
|Page Load Sample||825||516|
|Avg Page Load Time (sec)||6.99||6.23||11%|
|Avg. Redirection Time (sec)||0.16||0.33||-106%|
|Avg. Domain Lookup Time (sec)||0.12||0.07||42%|
|Avg. Server Connection Time (sec)||0.09||0.03||67%|
|Avg. Server Response Time (sec)||1.15||1.14||1%|
|Avg. Page Download Time (sec)||0.32||0.27||16%|
Just considering the homepage, which gets the majority of the site’s page views and visitors, we see a different story. For the homepage, pages loaded 9% slower with CloudFlare. Note that the sample size of tests is quite a bit smaller here, but we can still estimate that the load time was slower with 95% certainty using the difference between means probability function.
|BlueHost: Aug 1 – Sep 30||CloudFlare: Nov 1 – Dec 31||Difference|
|Page Load Sample||37||29|
|Avg Page Load Time (sec)||6.68||7.31||-9%|
|Avg. Redirection Time (sec)||0.08||0.69||-806%|
|Avg. Domain Lookup Time (sec)||0.12||0.06||50%|
|Avg. Server Connection Time (sec)||0.08||0.02||79%|
|Avg. Server Response Time (sec)||0.74||0.93||-26%|
|Avg. Page Download Time (sec)||0.25||0.20||22%|
Regional differences are important to me for this site because we are targeting audiences on different sides of the globe. A CDN should help with this. In fact, that is exactly what a content delivery network is for. For my site, the most important two locales are North America and Japan.
Comparing the US and Japan to their performance with BlueHost and with CloudFlare showed that both locales loaded faster, the US by 10% and Japan by 4%. Here again we also see that the redirection times were much slower with CloudFlare, by many times. That extra time in redirection must have been covered by the savings in page download times.
|Page Load Sample||US Differences||Japan Differences||Canada Differences|
|Avg. Page Load Time (sec)||10%||4%||30%|
|Avg. Redirection Time (sec)||71%||-5204%||-121088%|
|Avg. Domain Lookup Time (sec)||27%||71%||90%|
|Avg. Server Connection Time (sec)||78%||94%||81%|
|Avg. Server Response Time (sec)||-8%||-4%||47%|
|Avg. Page Download Time (sec)||8%||48%||-251%|
|Times in Seconds||US: BlueHost||US: CloudFlare||Japan: BlueHost||Japan: CloudFlare||Canada: BlueHost||Canada: CloudFlare|
|Page Load Sample||540||333||122||82||22||14|
|Avg. Page Load Time (sec)||5.57||5.01||6.54||6.25||6.89||4.79|
|Avg. Redirection Time (sec)||0.17||0.05||0.03||1.74||0.00||1.39|
|Avg. Domain Lookup Time (sec)||0.06||0.04||0.12||0.03||0.12||0.01|
|Avg. Server Connection Time (sec)||0.06||0.01||0.06||0.00||0.03||0.01|
|Avg. Server Response Time (sec)||0.97||1.05||1.28||1.34||0.90||0.48|
|Avg. Page Download Time (sec)||0.24||0.22||0.65||0.34||0.09||0.33|
I came across two issues of concern.
- Blacklisted IP: When visiting a local hospital in my hometown in Colorado, I discovered that the IP address blocks used by CloudFlare were blacklisted by the hospital. That meant that when I tried to access the site–front end or back end–I got an error message from the hospital router telling me something along the lines of, “Sorry, we don’t trust this IP because it’s on a blacklist so you can’t go there.” I contacted BlueHost and CloudFlare about it. BlueHost pointed me to CloudFlare. CloudFlare said there really wasn’t anything they could do about it. Obviously, enforcement of blacklisted IPs depends completely on the network you’re browsing on and could impact any shared hosting account, not just CloudFlare. So, I filed this concern under “important, but limited.”
- Extra DNS lookup: A quick DNS report showed that almost everything was good to go, except for an extra DNS lookup required with each and every call to the name server. “Glue at local nameservers: Oops! Your local nameservers don’t return IP addresses (glue) along with your NS records! This isn’t a fatal error but means an extra lookup needs to be performed increasing the load time to your site. You can fix this by adding A records for each of the nameservers listed above.”
How Did the Switch from BlueHost to CloudFlare Go?
Time & Stress
The actual act of switching over was pretty easy, as advertised. I started the process from BlueHost’s own control panel option for starting with CloudFlare. After signing up on CloudFlare’s site, I was unable to complete the process through the BlueHost cpanel for some reason.
Not a big deal though. I just went directly to my new CloudFlare account and completed their set up wizard. It took about 30 minutes in all and they make you feel confident enough throughout the process that the “stress to my stomach cost” was minor.
CloudFlare warns of possible issues and gives several options to scale back or ramp up security and other options. I went with the recommended base free package.
The only issues I’ve experienced are missing WordPress admin bar images and a couple of post saving errors. The post saving errors are obviously a concern in regards to lost work and knowing if something was published. I’ve seen this error twice and both times the notice was from CloudFlare stating that the page didn’t exist and that I should try going to the “live” site. Following their instructions worked and only led to minor loss in work.
After the minor errors and the blacklisted IP I had concerns. Additionally, my day-to-day posting and experience with the site didn’t seem noticeably different. However, looking through the stats shows that it is actually loading faster for my visitors.
In total it appears to have been worth it to me. Overall, pages are loading a bit faster and anything I can do to keep visitors on my site, the more pages they’ll view and the better the chance I have that they will share the site or click on an advertisement.