Yesterday, Amazon finally released the Content Delivery Network (CDN) they had been promising for several months. They're calling it
CloudFront, and so far it seems to be living up to expectations.
It's dead simple to set up if you're already using S3 to store your content. Both
Bucket Explorer
and
S3fox
have already integrated CloudFront support, so you don't even need to write any new code. Just configure a few settings, switch the CNAME records in your DNS, and suddenly your content is serving a lot faster.
How much faster? Lots. Here are my numbers for serving a one pixel .gif file to my development machine here in the North of England (I've given URLs that are guaranteed to point to the right places, even after my CNAME changes propagate):
Amazon S3:
https://s3.amazonaws.com/img.twiddla.com/images/pixel.gif
300ms - 800ms latency, ~0s download time
CloudFront:
https://d2livl246cusvi.cloudfront.net/images/pixel.gif
46ms latency, ~0s download time
S3 performance is all over the map. As expected. Amazon never intended S3 to be used as a direct web host, so it's no surprise that it performs like a big dumb file storage system.
CloudFront, however, is amazingly well tuned. That 46ms time remained constant within 2ms every single time I loaded that file. In other words, CloudFront is so much faster and more consistent that there is simply no reason not to use it for all your S3 content hosting starting today.
by
Jason Kester
Discuss on hacker news