CloudFlare Can Boost Sites Performance For Free

Website performance is a big deal. Experiments conducted by the biggest websites on the net conclude page performance is directly related to revenue. found a 2 second slow down equals a 4.3% reduction in revenue per user. A 400 millisecond delay on Google search pages led to 0.59% fewer searches per user. Aol found users who experience the fastest Web page load times view 50% more pages per visit than users experiencing the slowest page load times.

Content Delivery Networks (CDN) can be a big boost in page speed by 1) saving a copy of the fully-rendered page and 2) serving that copy from a server as close to the user as possible. Big CDNs like Akamai and CacheFly charge hundreds of dollars a month at the minimum. CloudFlare, a new  start-up, is hoping to change that by offering a CDN for free. I tried it out with two of my sites, this blog and, and below are my findings.

Setting up CloudFlare with my sites was a breeze. All you have to do is change some DNS settings to route your traffic through their servers. Since I use Dreamhost as a host, CloudFlare made it even easier by hooking into Dreamhost’s system to make the changes for me. An e-mail with the original DNS settings was also sent as a backup in case I wanted to revert back. Within 5 minutes, I was up and running. saw the most benefit from CloudFlare as it serves up dynamically generated images. Once that image was cached, any subsequent requests for that URL would be for a static image without needing PHP to create it. Dummyimage is popular and the reduced load on my measly shared servers was noticeable.

CloudFlare provides a bunch of stats for monitoring the amount of traffic going through their network as well as the bandwidth saved.  In my case, for both of my sites, I’ve saved 11.5 gigbytes of bandwidth on 23,985,639 requests in 14 days.

Another advantage of CloudFlare is the security aspect. The network will identify and block threats ranging from botnet zombies to web spammers. CloudFlare presents suspected threats with a captcha and a chance for the user to leave a message if they might have been falsely accused. Part of their stats lets you see all of the threats including ones that passed the captcha and/or left a message. So far I have seen no false positives.

So while things have been mostly great, there are a couple of drawbacks. For one, the service is still figuring things out. There was about 50 minutes of downtime when all sites running through CloudFlare were inaccessible. It didn’t irk me too much. I figure I can’t really complain when the price is free. Another issue is the stats take forever to load. The stats for the free version are delayed 24 hours on purpose, but several times when trying to access the statistics dashboard the site would timeout.

Because all of the traffic is now coming from the CloudFlare servers, any code on your end that relies on the IP address of the end user will need to tweak their code. CloudFlare has a simple guide for how to do this on their wiki.

So if you’ve made it this far you’re probably wondering, “should I run my site through CloudFlare?” If you run a personal site and can live with a little downtime here and there, then absolutely. If your site is your sole means of income and any downtime causes your blood to boil, then you should probably find a more trusted CDN (and expect to pay for it). You could always experiment with it over the weekend for a couple of days and then switch back if you run into problems.

Content Delivery Networks bring a big performance boost to a site and with a free one out there like CloudFlare, there’s no excuse to not be using one.

14 Responses to “ CloudFlare Can Boost Sites Performance For Free ”

  1. Hi Russ,

    Thanks for the very detailed review of CloudFlare.

    Note about downtime:

    We currently have 99.99% uptime, with a goal of getting to 99.999% (also building an auto-kill switch, which would serve traffic directly to you when we have an issue). We’ve taken every problem we’ve had to build safeguards to prevent it from happening again.

  2. Very nice! Any word on getting stats to perform a bit better? There constantly timing out for me.

  3. Hi Russ,

    Are they always timing out (stats)? If so, that seems odd. I do know we have a db fix that should make stats more stable coming soon. Please feel free to contact me if things don’t improve.

  4. Here’s a screencast of what it looks like on my end when trying to access the stats. It’s like this most of the time I try to get to the dashboard. The video is a minute and a half and weighs in at 9megs.

  5. In the first chart, the red and purple charts seem reversed. The “crawlers” number is less than the “threats” number, yet on the chart, “crawlers” is always greater than the “threat.” Could you investigate?

  6. CloudFlare can block threats before they get to your site. That would explain why the purple line is greater than the red line. The first graphic is telling you how many threats tried getting to your door, and the second shows how many made it to your site.

  7. Hi Russ,

    Very strange. Which browser and OS are you using? This is happening with any browser you try as well?

  8. Mac OSX 10.6.4 Firefox 3.6.11

    Come to think of it, it works just fine in Chrome. Good to know.

  9. Hi Russ,

    Thanks. Pinged our UI and stats’ guy.

  10. hello,

    I’m considering using CloudFlare to improve the performance of a flash/php/mysql/ajax site but have just a couple of questions. Hope you can help out:

    1- Does CloudFlare natively handle embeds from other domains? For instance on my site I embed content hosted on

    2- Does CloudFlare support IP authentication? I mean some of my scripts check a visitor’s IP address to assess what to show him in browser.

    3- When I change DNS settings in switching to CloudFlare, will my website be down? If so, for how long?

    I’m not a coder, so info as easy to follow as possible would be very helpful.

    thank you,
    -Patrick S

  11. Hello,
    1. I don’t think CloudFlare cache media from another domain. You can still continue to use embeds just like you always have been using them without any problem.

    2. CloudFlare makes it easy to get the IP address of the user server side. Just follow the code in this guide to make sure the Remote Address variable is the Users IP and not CloudFlare’s. This should be pretty much the first thing in your PHP script.

    3. There shouldn’t be any downtime. What is happening is you are saying “Hey my server is over here (pointing to CloudFlare)” and if your audiences DNS records haven’t been updated then they will just go straight to your site.

    Have fun.

  12. Thank you, that was helpful 🙂 Your answer referred to a guide with code that would point the Remote Address variable to the User’s IP, but does not actually point to the guide.

    One more Q you may know the answer to. I have flash movie (swf) files that first check that they’re being run from my domain before executing; otherwise they close automatically. For instance, if a user downloaded and saved the swf file and tried to open it locally, it wouldn’t work. Any idea whether such files would be able to run once I use CloudFlare? My fear is that since CloudFlare will be caching the files offsite, they will not run.

    -Patrick S

  13. Oops! Here is the link ->

    Your flash files that check the domain form which it is run should still work. Otherwise you can expand the logic in your SWF to accept the CloudFlare domain as well.

  14. […] CloudFlare provides free and paid-for services that can enhance your website performance.  The key to the service is a Content Delivery Network that aims to speed up your site but has added benefits such as: some protection from Denial Of Service (DOS) attacks; Optimising code for mobile browsers; Usage Statistics and providing additional services (Like global Google Analytics or PunchTab loyalty programme) for free or a fee.  An example case study can be found here. […]

Leave a Comment of Your Own