APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

More about Cloudflare


2013/08/30

I mentioned yesterday that I added CloudFlare to this site. CloudFlare is a proxy service that provides caching, minification and security for websites. I was more than a little nervous about turning it on, but it seems to be working wonderfully (at least from my part of the world). As all I've really changed is my DNS servers (no code changes on your site at all) this would be trivial to turn off if I needed to.

The pricing is good, starting at free. I chose the $20 a month plan, which is quite suitable for me, but they do have larger plans for bigger sites.

I said I made no changes to my site, but I did add an Apache module to keep my logs accurate. If you don't care about your raw Apache logs (for example you get all you want to know from Google Analytics), you wouldn't bother. Your Apache access.log would have Cloudserver IP addresses rather than that of your real visitors without that module. You'd still know which pages were accessed; you just wouldn't know by whom.

Wait - didn't I say this was a caching proxy service? Wouldn't your real visitors get their pages from Cloudflare's proxy servers?

Well, yes. but it's a reverse proxy. And no, CloudFlare does not cache HTML content by default. If you had content that will rarely change, you can cache it, but that's not default. CloudFlare minifies (strips out unnecessary white space) and does cache Javascript and does also provide security filtering (though apparently not as good as others).

Whatever - from what I can tell, my pages are loading faster. There's no interference with things like Google Analytics, and if their security isn't as whiz-bang as a a manual configuration of mod_security could be, it's better than not having anything (which was exactly what I had).

Analytics

CloudFlare shows me what it thinks it has speeded up:

CloudFlare Analytics

Initially, these charts confused me. In the time period covered, there were a lot more visits than shown there. Possibly that's because the DNS change hadn't fully propagated yet, A few days later the charts looked more accurate.

Cloudflare explains that the data may actually seem too high. They note:

Google Analytics and other web-based analytics programs track
visitors that trigger JavaScript. As a result, threats, bots and
automated crawlers are not recorded since these visitors typically
do not trigger JavaScript. These services also don't track visitors
who leave a page before it is fully loaded or have Javascript
disabled. CloudFlare tracks all of your traffic by requests, so
your CloudFlare visitor number is most likely higher.
 

They do show stats for bots and threats; I wish they'd also show the human visits with Javascript disabled. You might be able to get a rough approximation from subtracting what Google Analytics reports from CloudFlare's numbers; for the day shown above, that would have been about 75%, which seems unlikely. I'll keep analyzing this over time and see what I learn.

Apps

Proxying affords the opportunity to add apps and features without adding code to your actual pages. CloudFlare has a number of such apps, some free, some requiring subscription. I added the "old browser warning" app and Trumpet, which lets you add a site wide message instantly. I could have used that to tell visitors about the change to CloudFlare or about expected outages due to planned updates and so on.

So, it's all in place and we'll see what happens. Please do let me know if you notice any odd behavior!



Got something to add? Send me email.





Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Connect Mailserver

Kerio Samepage

Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





The primary duty of an exception handler is to get the error out of the lap of the programmer and into the surprised face of the user. (Verity Stob)

That's the thing about people who think they hate computers. What they really hate is lousy programmers. (Larry Niven)












This post tagged: