Content-delivery networks
Learning objectives
- You know what Content-Delivery Networks (CDN) are.
- You know the key features of a CDN using Akamai as an example.
Regardless of advances in the HTTP protocol, distributing work and content over multiple servers and hosts is meaningful. This increases the potential number of concurrent connections that the browser can use to load the content, and consequently also reduces the load on individual servers.
Content-delivery networks are networks of servers used for distributing (primarily) static content.
Content-delivery networks can be seen as a shared cache, where cacheable data (static website content) is distributed across servers. These servers typically have a range of hostnames, which differ from the host of the web server(s) responsible for serving dynamic content. The range of hostnames allow browsers to open up more connections for requesting content, avoiding the limitations on persistent open connections outlined in RFC2616.
In practice, when a CDN is used, the response from a server links resources to external addresses, which the browser then retrieves. An example of a possible HTTP response is outlined below.
HTTP/1.1 200 OK
(headers)
<html>
<head>
<link rel="stylesheet"
href="https://s1.cdn-srvr.com/identifier/styles.css">
</head>
<body>
<img src="https://s2.cdn-srvr.com/identifier/retro-sax-guy.gif" />
</body>
</html>
When the browser receives a response like the above (regardless of the host of the server serving the response) the browser retrieves the resources at addresses https://s1.cdn-srvr.com/identifier/styles.css
and https://s2.cdn-srvr.com/identifier/retro-sax-guy.gif
. As the host names for the two resources differ (s1.cdn-srvr.com
and s2.cdn-srvr.com
), the browser could simultaneously open a connection to both of them, even if the browser would have a very restrictive one connection per host policy.
An alternative option would be to give the CDN provider the control over name servers of the web application domain, which would allow proxying requests over the CDN. In such a case, specific paths of the application could be configured to be handled by the CDN, while other parts could be directed to the web application.
The use of a CDN can lead to significantly fewer requests to the application servers as the requests for static resources are distributed to the CDN. They can also lead to faster web application load times as the static resources can be loaded from servers that are close to the user, and they can also increase reliability of the application, as resources on CDN could be available even if the application servers would not be available.
However, similar to caching in web applications, CDNs also suffer from issues such as stale cache and can even open create vulnerabilities. As an example, if the static resources served through CDNs include code executed on the client (as is often the case), a malicious user could influence data on the CDN, leading to loading vulnerable client-side code on the client. In a similar fashion, CDNs could be used for e.g. denial of service attacks (see e.g. RFC8586).
Next, your task is to read the article The Akamai network: a platform for high-performance internet applications and create two questions based on it.
For writing the question, refer also to the notes on good questions.
Write the questions using the widget shown below.
Question not found or loading of the question is still in progress.
Once you have created the two questions, answer six or more peer-authored questions below. After each question, you are given a possibility to rate the question -- please, rate each question that you answer.