Turning on Cloudflare

Speed is good – there are plenty of studies linking server speed and sales conversions on e-commerce sites. I’ve set a goal of getting our average page load time below three seconds as measured by Google Analytics.

One way to speed up a website is to use a Content Delivery Network (CDN). CDNs use a number of techniques to speed up content delivery.

CDNs have locations around the world, hence the network part of the name. When a file is requested the CDN determines the quickest path to get the file to the user, based on their location and network path. CDNs also tend to be lightning fast in terms of DNS response, redirect time, server response time, and Internet connection speed.

I’ve been making baby steps towards using a CDN at the e-commerce website I manage. With just some small changes the speed difference has been tremendous. The CDN is delivering static files like images, JavaScripts, and CSS files two, three, four times faster than we can. Besides delivering files faster, the CDN is offloading those requests from our server and Internet connection to theirs. That should make the server respond better to the requests it’s still handling, such as dynamic pages.

Right now we’re just using the CDN to serve out header and footer template images – things like the logo, navigation buttons, and CSS and Javascripts that are common to most pages. To really take advantage of the CDN we need to use it to serve product images, of which we have many thousands and which account for the majority of our downloads. The challenge is that as new products are created and new product images are uploaded, we’d need some way to make sure the new images are synced with the CDN.

One way to sync them is to select a CDN that supports caching reverse proxy. We upload the image. Our e-commerce system will put it in the right directories on our servers, such as/images/product/image.jpg. We change our templates to call the images from the CDN instead of our server using the same directory path, such as http://www.cdn.com/images/product/image.jpg. The first time the file is requested from the CDN it will realize it doesn’t have it, then look for the file on our website in the same directory. From then on the CDN caches the file and serves the file from its own servers.

Another way to move all of the images to the CDN is CloudFlare. Instead of changing URLs and uploading files, you just change your domain records to point your domain’s IP address to CloudFlare. All requests for anything on your site goes through CloudFlare. They cache the content that comes from your site and then serve it out over their CDN the next time it’s requested. All of your URLs stay exactly the same. The basic plan is free. Paid plans add some interesting features, like DDoS protection, additional speed enhancements, and mobile optimization.

As a first step, I’m going to try CloudFlare here on the blog. I use Dreamhost Web hosting and you can literally enable CloudFlare on Dreamhost accounts with a click of a button. (Go to the Dreamhost Control Panel, click Manage Domains, and click the Edit button next to the domain you want to accelerate with CloudFlare.)

CloudFlare on Dreamhost

Don’t take this post as an endorsement of CloudFlare, BTW. I haven’t used them yet, so I have no idea how they’ll perform. I’m just sharing the process and letting you know why the blog may behave a little differently the next few days. Or maybe it won’t behave any differently at all. The only way to find out is to try.

CloudFlare is turned on … now.


Selecting the Right CDN for YOUR Website

Improving page speed: CDN vs Squid/Varnish/nginx/mod_proxy 

Apache – Forward and Reverse Proxy

“Real World” Performance Comparison of CDN (Content Delivery Network) Providers

Best Way to Compare CDN Performance?
2013 Best Small Business CDN Reviews and Comparisons

One Response to Turning on Cloudflare

  1. Bill says:

    This is subjective but your website seems faster to me. I noticed it before I read this post.