Turning on Cloudflare
October 7, 2013 1 Comment
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.
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.)
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.