Content delivery network

[ ]

A content delivery network (CDN) is a globally distributed network of proxy servers, serving content from locations closer to the user. Generally, static files such as HTML/CSS/JS, photos, and videos are served from CDN, although some CDNs such as Amazon’s CloudFront support dynamic content. The site’s DNS resolution will tell clients which server to contact.

Why CDN works

Serving content from CDNs can significantly improve performance in two ways:

  • Users receive content at data centers close to them
  • Your servers do not have to serve requests that the CDN fulfills

Types of CDNS

Push CDNs

Push CDNs receive new content whenever changes occur on your server. You take full responsibility for providing content. Sites with a small amount of traffic or sites with content that isn’t often updated work well with push CDNs. Content is placed on the CDNs once, instead of being re-pulled at regular intervals.

minimizing traffic, but maximizing storage

Pull CDNs

Pull CDNs grab new content from your server when the first user requests the content. You leave the content on your server and rewrite URLs to point to the CDN. This results in a slower request until the content is cached on the CDN.

minimize storage space on the CDN, but can create redundant traffic. Sites with heavy traffic work well with pull CDNs

Disadvantages

  • CDN costs could be significant depending on trafficN.
  • Content might be stale if it is updated before the TTL expires it.
  • CDNs require changing URLs for static content to point to the CDN.
Written on March 30, 2019