Cloudflare…I think I’m in love!

Post Published on September 24, 2011.
Last Updated on April 24, 2016 by davemackey.

Image representing CloudFlare
Image via CrunchBase

Here is the problem. Folks like me run websites like this one and use shared hosts like Bluehost. As the sites grow and our traffic increases the site speed slows down. This leaves folks like me in a difficult spot. How do we get our sites to run faster? We could move to a Virtual Private Server (VPS). These are generally affordable but they also are much more manual than Bluehost. I can get a WordPress up and running in five minutes using Bluehost – whereas with a VPS I’m left working with the command-line – not only installing my own WordPress from scratch but also configuring Apache, MySQL, and PHP. A dedicated server offers the same problems at a higher price.

Then there is the option of going with a cloud-based service. These services are pretty attractive – the ability to scale is magnificent, but the price is somewhere between a VPS and a dedicated server – and usually costly enough that any ad revenues one receives will be consumed several times over by the hosting costs. Again, there is also the simplicity issue. I haven’t found a cloud service that can compare to Bluehost for ease.

For some people this may not be as big of a concern. Some folks love delving into the code. I do too, but I also love creating and curating contents – and usually my focus is on the latter…and thus why I love Bluehosts streamlined and wizard-like interface.

Bluehost, unlike most other shared hosts, does offer a higher performance hosting option – still shared. I purchased this, but still was seeing my pages clock in (according to Pingdom) at between 10-13 seconds in loading time. This simply isn’t acceptable if you want to keep folks attention.

This is where CloudFlare comes into the picture. CloudFlare isn’t a replacement for your current hosting plan, but a supplement to it…and its not just for little hobbyists like myself – it can be used by smbs and the enterprise. The best part is that for the hobbyist the service is free, and for smb’s it is only $20/mo.!

CloudFlare offers all sorts of features – focusing around performance and security. We’ll focus mainly on the performance aspect. Lets talk for a moment about how the “big guys” make their sites load so fast:

  • Raw Processing Power – The big guys have lots of processing power to run their sites. A hobbyist on a shared host is one of hundreds of sites on a single physical server. The big guys use multiple physical servers with load balancing to provide massive amounts of computational power that can handle large loads of traffic.
  • Code Optimization – The big guys have the budgets and the time to commit coders who pour over the code again and again looking for ways to optimize the code, removing extraneous bulk and making the end-product that is delivered to the user as small and quick as possible.
  • Content Distribution Network (CDN) – The big guys also use servers in multiple locations to provide the same content. In this manner they are able to direct visitors to the servers that are geographically closest to them, reducing the amount of time it takes for data to travel from the server to the end user’s computer.

Now, CloudFlare can’t really help us with the code optimization – but they can supplement our processing power and provide a content distribution network (CDN) and this is exactly what they do. They take all of our static material (material not drawn from a database) and host it on their worldwide network of servers, providing local access to viewers and massive amounts of processing power.
Update: This morning I was pleasantly surprised to have received a reply via Twitter to this post by CloudFlare CEO Matthew Prince who wrote, “@davidshq thanks for the review. Only nit: actually we do code (HTML) optimization. Try CF’s Rocket Loader. Adds another 20% speed boost!”
Sure enough, Matt wasn’t lying and I turned on Rocket Loader and Auto Minify to receive even greater speed boost as CloudFlare automatically compresses and expedites various aspects of my code.
Granted, the “big guys” still have the advantage of coders who can review code line-by-line to remove slow code, but with all CloudFlare’s features, how much longer will this sort of manual optimization be necessary in all but the most severe cases?
(For those like me who had a little trouble finding Rocket Loader, check out this CloudFare FAQ)

For those who are wondering, even sites like WordPress which utilize a database back-end are largely static sites when it comes to viewers. A technique to increase responsiveness of sites and reduce load is caching. This involves the creation of a static page containing the content that is pulled from the database. In this manner the content is pulled from the database once and then the users view the static pages. When a change is made to the content, the data is pulled from the database again and used to create an updated static page.

I’ve only been running CloudFlare for a little while on this site – but I’m already seeing tremendous performance gains – specifically in site speed. Before adding CloudFlare loading the main page of the site (directly from bluehost’s servers) was taking 10-13 seconds, now it averages between 5-7 seconds. This is a huge drop in loading time!

What is the practical result of all this? Well, it probably means that I could downgrade my bluehost account to the basic hosting and just rely on CloudFlare to provide the computational and geo-distributed power. It also means that folks like myself can wait much longer before needing to move to a more robust hosting solution.

This is truly an amazing service (especially for free!). It takes around five minutes to configure (literally!) and I’ve not even scratched the surface of the features that are offered – for example, a robust anti-spam intelligence that grows with its network of sites. So, if you haven’t already – go check CloudFlare out. No, I’m not on their payroll!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.