tags:

views:

137

answers:

1

I'm trying to figure out the effectiveness of using a CDN versus hosting images locally. Assuming that our load is such that serving an image or javascript file from the same server that is hosting the HTML content will not be any slower when compared against using a CDN, at what point does locality take effect?

My understanding of how a CDN works is that one request goes to the main CDN site for the file. This site only routes requests, so it issues a redirect to the other webserver that is (in theory) closer to the user making the request.

However, the overhead of 2 HTTP requests and 2 connections could actually add overhead compared to one request that suffers greater latency.

My question is, does anyone have any numbers or articles regarding at what file size decreased latency makes a big difference, and makes it an obvious choice to switch to a CDN?

+2  A: 

Based on Yahoo's YSlow tool and any tests I've done, splitting across hosts for images, css, and javascript is a great idea and improves speed.

In addition, if you can manage it, serving up your static content from a domain that doesn't serve up cookies will also add a speed boost.

From the Yahoo developer help section for YSlow: http://developer.yahoo.com/performance/rules.html#cdn

"Remember that 80-90% of the end-user response time is spent downloading all the components in the page: images, stylesheets, scripts, Flash, etc. This is the Performance Golden Rule. Rather than starting with the difficult task of redesigning your application architecture, it's better to first disperse your static content. This not only achieves a bigger reduction in response times, but it's easier thanks to content delivery networks."

scunliffe
Thanks for the answer. Cookies are something I would have never thought about.
NilObject