So far in our series on Web Performance Optimization, we’ve focused on how to reduce the number of requests between client and server through caching, and how to make requests more efficient by managing server resources. Another strategy in Web optimization is intelligent distribution of resources across the Internet, which can greatly reduce request latency by locating redundant copies of Web content on multiple servers spread across the Internet. In this installment of our series, we focus on content delivery networks (CDN), a technology that increases throughput by bringing content closer to the people requesting it.


What is a CDN?

In the simplest Web site configuration, a single Web server services requests from multiple clients. While this is often good enough for the simplest, lowest traffic Web sites, complex Web sites that need to scale to thousands or millions of visitors require more processing power. This is why many sites have resorted to using Web server farms, which are clusters of multiple Web servers offering redundant copies of a site’s content. Web farms use load balancing software to monitor the amount of load on any one server. They can also use this information to route requests to the server with the least load at a given point in time.

web optimization content delivery networkA CDN is a type of Web farm or server cluster, except that instead of using a single farm or cluster, the servers are spread out over the Internet in multiple geographical locations. These are called edge servers, because they are located at the extremes, or edges, of the Internet, instead of all being located off of a central Internet backbone link. The goal of a CDN is to decrease the time it takes to deliver content to a specific user based on that user’s location.

Let’s say, for example, that a company based in New York receives a request for Web content from a user in Seattle, WA. In a traditional setup, the Seattle computer’s request would have to find the most efficient route on the Internet to New York, usually via a busy backbone link. In a CDN configuration, the CDN could tell the Seattle client that its nearest edge server is on a subnet in Portland, Oregon. By obtaining the content from a server closer on the network, the client greatly reduces request latency.


The Uses of a CDN

CDNs can be used for a wide range of content. The majority of a Web page request is spent downloading dependencies such as images, CSS scripts, and JavaScript files. Placing this relatively static content on a CDN can provide a significant performance boost. Companies that serve streaming content, such as audio and video, can utilize CDNs to deliver high-definition video streams and high bitrate audio with better image quality and fewer pauses to buffer content.


Performance Benefits

The boosts achieved from using a CDN can be significant. In 2010, the CDN performance tracking site not only compared the performance of 24 CDN and cloud computing companies against one another, but also compared the performance of cloud-based Web sites both using a CDN and not using a CDN. The results were astounding: for every cloud-based provider tested, found that adding a CDN into the mix provided a speed boost of up to 50%.

Another company that noticed the performance benefits of CDNs is Yahoo!. The company claims that when it started using a CDN in 2007, it achieved a 20% or greater boost in end-user response times.


Types of CDNs

CDNs differ in how they cache content and deliver it to users. Following are some of the most common types of CDN.

  • Push. In a push CDN, a central server replicates its contents to the edge servers, so that every edge server has the latest copy of the content on the origin server.
  • Origin Pull. An origin pull CDN server caches the latest copy of a static file from the origin server, and serves this cached copy to subsequent users. The caching Web server relies upon the caching mechanisms defined by the HTTP/1.1 protocol, which we covered in a previous article.
  • Application. While most CDNs deploy static content, an increasing number are branching out to offer distributed application services, replicating server-side applications written in languages such as PHP and .NET to edge servers. EdgeCast Networks launched its own application CDN service in April of last year, claiming that the companies that tested the service in beta experienced performance gains ranging from 40 to 250 percent.
  • Peer-to-Peer. A peer-to-peer CDN shares cached content amongst users of the same site. For example, User 1 downloads the first minute of a video from a popular Web site. When User 2 and User 3 request the same content, the CDN instructs them to download it from User 1, thus reducing the overall load on the origin server. This CDN model is most typically used for audio and video content.


The Costs of Using a CDN

One of the benefits of using a CDN these days is that there are so many providers. This means that development teams need not squander resources development their own CDN solutions. Furthermore, the abundant competition has also pushed prices to all-time lows. Most CDN companies offer their services on a metered basis, and charge only pennies per gigabyte of data served to users. Other CDN providers charge flat fees, such as $40 or $60 for the first terabyte – enough bandwidth to serve many small sites for a full year.



CDNs have an excellent cost/benefit ratio, as they expand Web server capacity by 20-50% or more at low cost to the Web site operator. Whether you run a small site with thousands of users a day or a massive site that serves millions, you can achieve significant performance testing improvements by offloading all of your static content to a CDN.