Definition

A content delivery network (CDN) is a collection of global servers that caches and delivers content such as images, videos and Javascript files. When a user requests a web page, for instance, content on that page is delivered by the closest edge server rather than the origin server, thereby decreasing page load time.

MaxCDN graphic for content delivery network.

Overview

Performance, reliability and bandwidth are major factors for online service providers that directly impact profitability and customer satisfaction.

A CDN is a distributed group of servers that can withstand high amounts of traffic, provide inexpensive data transfer costs, and provide reliability. Many websites and online services rely on CDNs as a cost-effective way to improve uptime and performance.

How A CDN Works

Typically, when a user visits a website, their browser downloads every referenced asset (images, videos, CSS/Javascript) from a single origin server. If the origin is in New York and the user is in Japan, each asset must be downloaded from across the world. In a case like this, users experience longer page load times due to higher latency.

A CDN distributes files to servers around the globe, reducing the time needed to access a file. For example, users in Japan could download files from a nearby server in Asia instead of one in North America.

Here’s a step-by-step description of how a CDN works:

  1. The website administrator for example.com (the origin server) signs up with a CDN provider. The CDN provider gives the administrator a url for the CDN such as example.some-cdn.com.
  2. The website administrator configures the site to load assets (images, videos, CSS/Javascript files) from the CDN url instead of the origin server. With software like WordPress, this change can be made using a plugin.
  3. A user opens example.com in their browser. The browser requests assets that are referenced inside the page using a CDN url such as http://example.some-cdn.com/image.png.
  4. The CDN automatically distributes incoming requests to the nearest CDN server, using technologies like DNS load balancing and Anycast routing. Files not already on the CDN are downloaded from the origin server and stored.
  5. The browser downloads assets from a nearby CDN server, thereby improving performance and reducing traffic for the origin server.

CDN providers use additional techniques to optimize the delivery of files, such as compression, caching and special HTTP headers.

Example of a CDN

Many websites use third-party libraries like Twitter Bootstrap to improve their layout or functionality. However, the administrator may not want to host the libraries directly, which costs bandwidth and may involve maintenance and updates.

Services like Bootstrap CDN let users load the CSS and Javascript files for Twitter Bootstrap from a CDN. This reduces server load and speeds up access for users. Additionally, users can avoid re-downloading the files if they’ve already visited a site that uses the same files on Bootstrap CDN.

Benefits of a CDN

A CDN offers numerous benefits for a website or online service:

  • Users experience faster load times because assets are downloaded from local servers instead of faraway ones.
  • Enterprises save on bandwidth costs since CDNs can purchase bandwidth in bulk and pass this discounted rate to their customers.
  • Enterprises reduce server load because asset requests are routed away from the origin server.
  • Enterprises improve server reliability as CDNs are part of failover plans to route traffic to new locations should a server be taken offline.

Conclusion

CDNs are a popular way to distribute traffic, and nearly a requirement in order to run a fast, reliable website at scale. Also, the vast majority of the top 10k websites rely on a CDN.

  • Mary Smith

    Thanks for information. I have a question. Do all described features characterize any CDN? I’ve recently bought http://cdnsun.com/ and I still don’t understand all aspects of its work. For exampe this feature “​Enterprises reduce server load because asset requests are routed away from the origin server.” Is it in any CDN?

    • Ivan Dabic

      Hi Mary,

      That is just the essential CDN behaviour. Assets are nt loaded from your hosting/origin server, rather, those are now loaded from CDN server thus, reducing the load on hosting/origin server.

  • Denis Roche

    Is the content that is pushed to the edge servers for storage transported by the web or do most companies buy direct connectivity to the edge servers.

    • http://robertgibb.me Robert Gibb

      This is a great question. And the simple answer is “by the web.” Because there are so many different hosting providers, it wouldn’t make economic sense to buy a direct connection from them to every single edge server owned by a CDN. So whenever content is “pulled” from your origin (hosting provider) and distributed to a CDN’s edge servers, it makes use of the “the web.” The web being infrastructure created by Internet Service Providers (ISPs) and similar Internet-focused companies.