If you've used Google PageSpeed, or Pingdom's Full Page Test, you may have learned something you didn't already know. That is, that web browsers don't like to grab content from the same host name more than 2 connections at a time (may vary depending on browser/settings). So, if your website requires dozens of images, css and script files with each page request, you could have the fastest server in the world, but the users web browser becomes the bottleneck.

Enter the Content Delivery Network (CDN). A CDN essentially distributes your images, css and scripts across a network of servers located throughout your region, country or the world, to allow these files to be accessed quickly depending on your users location.

So, not only does this allow you to deliver your content faster, but it also provides another host name with which to serve your content, making PageSpeed and Pingdom's test very happy!

So, the question is, "is it worth the cost of a CDN"? Well, let's do some math. Let's assume that you wish to serve all of your template related images, css and script files through a CDN, and that their total size is 100kB. After researching a couple leading CDN providers, you determine that the average cost per gigabyte is 10 cents.

1GB / 100kB = 10,000

So, you would be able to serve 10,000 page requests through your CDN for about 10 cents. If you serve 10,000 page requests per day, your cost will be about $3/month. Not bad!

There seem to be two major players in the CDN market:

  1. Amazon CloudFront
  2. MaxCDN

While MaxCDN's price per GB seems a little friendlier, they seem to be wishy-washy on the pay-as-you-go option. Meaning, the $39.95 flat fee slashed down to $1 promotion might require some research on your part.

But, let's not forget about The Coral CDN, which is entirely free. I've personally used it to serve "non-critical" web files and have seen a nice performance boost.

The way they serve the content is actually quite clever, and ridiculously intuitive. If you have an image, for example, your logo, hosted at:

http://www.example.com/src/logo.jpg

To serve this file from The Coral CDN, simply append their domain name to yours! For instance:

<img src="http://www.example.com.nyud.net/src/logo.png" alt="" />

I didn't believe this until I tried it – it works for every type of content! So, you have options when it comes to CDN, but I think we can all agree that choosing a CDN in general is a smart idea.

Tags:

1 Comment

  1. I should add another option to the list above. If you are not interested in a CDN, but purely to allow more simultaneous downloads from your visitors browser, you can always create another A record for your domain, and configure it to point to your site. Using the example above:

    <img src="http://images.example.com/src/logo.png" alt="" />

Leave a Reply

Your email address will not be published. Required fields are marked *