AWS CloudFront has many bizarre quirks:

  • only two invalidations of 1000 paths can run concurrently
  • each invalidation takes about 5-15 minutes to complete
  • there is no "clear all cache"
  • configuring gzip compression is nontrivial

I'm comparing the alternatives to CloudFront for static web content (html, css, js, images), specifically Azure, CDNify, CloudFlare, CDNSun, Fastly, KeyCDN, and MaxCDN . I've picked only CDNs that made pricing information available (which eliminated most of the options I could find). Pricing is a feature, and typically CDNs without pricing information didn't disclose their feature set online either.

One CDN that looked fantastic but didn't make the cut was Highwinds. They provide loads of documentation and a free trial, but no pricing information.

Pricing Comparison

CDNPricing ModelCosts (US)HTTPS PricingFree Option
CloudFrontPer GB$0.12$0 - SNIY - 1 yr
AzurePer GB$0.12UnknownY
CDNifyFlat Rate + Over 150GB$10.00 + $0.07$0N
CloudFlareFlat Rate$20.00$200/mo PlanY
CDNSunPer GB$0.45$699/yrY - 15 days
FastlyPer Request + Per GB$0.01 + $0.12$500 setup + $100/monY - 30 days
KeyCDNPer GB$0.04$0N
MaxCDNFlat Rate + Over 100GB$9.00 + $0.08$39/moN
  • "Per GB" (normal font) refers to bandwidth charges
  • "Flat Rate" (in bold) is per month fees. "Over ___ GB" specifies the included bandwidth
  • "Per Request" (in italics) refers to individual requests between edge and client

The standard going rate for CDN bandwith is 12ยข. KeyCDN is the cheapest option, and CDNSun is priciest.

Network Comparison

CDNHTTPSPOPsLatencyGzipMinification
CloudFrontY5047Y - in originN
Azure?3047Y - in originN
CDNifyY2077YN
CloudFlareY2549YY
CDNSunY85??Y
FastlyY2058YN
KeyCDNY15?YY - images only
MaxCDNY1544Y - in originY
  • There is no information about using HTTPS with Azure in the Microsoft documentation or pricing
  • "POPs" or Points of Presence refers to how many geographically separate data centers a CDN has (number of servers per data center can vary)
  • Latency is measured in milliseconds by Citrix ITM (formerly "Cedexis") as of 5/26/2014
  • A "Y" for Gzip means that the CDN can transparently handle compression during transmission over the network for you. "Y - in origin" means your origin server must handle compression, but the CDN can intelligently serve compressed files

The only big difference between these CDNs IMHO is whether or not the CDN can handle Gzip compression for you without configuring an origin server. Ideally, you could just dump your pre-minified files onto a cloud storage service such as AWS S3 or RackSpace CloudFiles and let the CDN handle this for.

Caching Behavior Comparison

CDNHeadersCookiesQuery StringProtocol
CloudFrontYYYN
AzureYYY?
CDNify????
CloudFlareYNYY
CDNSunYYY?
FastlyYYYY
KeyCDNY?Y?
MaxCDNYYY?
  • "Headers" refers to respecting the origin's Cache-Control (or other caching specific) headers
  • All columns refer to the ability to vary the cached content served to visitors by examining this information

The winner in this category appears to be Fastly, with CDNify providing virtually no information about how configurable its caching behavior is.

Configuration Comparison

CDNLatencyPurge AllAPI
CloudFront10 minsNY
Azuremins??N
CDNifymins?YY
CloudFlaresecsYY
CDNSunmins?YY
Fastly150 msYY
KeyCDN5 minsY?
MaxCDN30 secYY
  • "latency" means the time required to update the edge servers with configuration changes (or purges/invalidations)
  • Except for AWS CloudFront, all latency information is taken from the self-reporting of each company's website
  • "mins?" means that the company did not state how long, and I assume changes will take minutes to propagate across edge servers

Fastly comes out ahead in this category, with MaxCDN and CloudFlare close behind.

And the Winner Is...

For me, it's a toss up between KeyCDN and MaxCDN. I really like the fast configuration updates that MaxCDN boasts, but I wish the SSL/TLS pricing model was a bit cheaper. If you just want to get a CDN out there and don't want to do much configuration, Key CDN seems like the way to go.

Fastly is my third place runner up. The incredible documentation, low latency, and extreme configurability make it the power house in the group. Sadly, hosting a custom SSL certificate on Fastly costs a small fortune.