What are the advantages and disadvantages of using a content delivery network (CDN)? [closed]

StackOverflow https://stackoverflow.com/questions/2145277
  •  | 
  •   ( words)


I was going through Best Practices for Speeding Up Your Web Site from developer site of Yahoo...

  • What are the advantages and disadvantages of using a content delivery network (CDN)?

  • When to use a CDN?

  • Is a CDN a performance booster?

Was it helpful?


What are the advantages and disadvantages of using a content delivery network (CDN)?

  • The disadvantages may be that it costs money, and it adds a bit of complexity to your deployment procedures.

  • The main advantage is an increase in the speed with which the content is delivered to the users.

When to use a CDN?

  • It will be most effective when you have a popular public website with some type of static content (images, scripts, CSS, etc.).

Is a CDN a performance booster?

  • In general, yes. When a specific request is made by a user, the server closest to that user (in terms of the minimum number of nodes between the server and the user) is dynamically determined. This optimizes the speed with which the content is delivered to that user.


One other item to consider (that has recently been thrust upon us): Your clients may block the CDN! I'm using Microsoft's CDN for jQuery and last fall we chnaged from the microsoft.com host name to ajax.aspnetcdn.com (to avoid the unneeded cookies when downloading jQuery). Since then we have had several customers with network filters that blocked aspnetcdn.com and had to manually whitelist it.

We will continue to use the CDN, but it opened our eyes to yet another problem it could cause.

Each CDN provider is different but you should really look into their network and how it might effect your target audience, especially so if your website audience is heavily localised in one part of the world.

In our testing, we found the majority of users (depending on which ISP they where connecting from) where not seeing any performance benefit as the CDN provider we were looking at using was not paired with their upstream provider. Packets were not being routed along the "main tubes" and performance would have dropped had we gone ahead.

With that said the above situation is probably not all that common, but it's still good idea to test. Bring up a version of your site using resources from a CDN and test in different locales and on different connections and measure the results.

There are other benefits as well; browsers taking advantage of multiple domains and having more simultaneous requests, less load for your server etc. Generally speaking, CDN is a good option.

A CDN is a performance booster if a lot of content come from the CDN.

Normally you have two connections each time to get content for each domain so each item is a connection.

If you have content on a CDN from another domain you have more connections for your site and your site will load faster.

I normally use a CDN for JavaScript libraries and only if I trust the CDN and check the uptime from the CDN you want to use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow