Content Delivery Network (CDN)

Zaid Alissa Almaliki
2 min readOct 19, 2022

--

In the simplest terms possible: a global network of servers. When a user visits a website that makes use of a CDN, the website determines which server is the closest to the user’s location and provides resources from there. As a result, the contents travel a shorter distance to the user and take less time to load the website.

A CDN enables the rapid delivery of resources such as Html files, JavaScript files, css files, pictures, and videos that are required for Internet content to load. As CDN services gain more and more traction, they are now used to handling the vast majority of online traffic, including that coming from famous websites like Google, Netflix, and Amazon.

Content Delivery Network

How does CDN work?

At a high level, CDN functions as follows: whenever a user accesses a website, the CDN server that is nearest to them will provide static material. It seems sense that a website would load more slowly the farther people were from CDN servers. Users near Paris will receive material more quickly than users in Los Angeles, for instance, if CDN servers are located in London.

How CDN works?
  1. Using an image URL, User A tries to download image.png. The CDN provider offers the domain for the URL. The following image URL is a sample used to demonstrate what image URLs look like on Amazon. https://dataakkadian.cloudfront.net/logo_dataakkadian.jpg
  2. If the CDN server does not already have image.png in its cache, it requests the file from the origin, which might be an online repository like Amazon S3 or a web server.
  3. The origin sends the image.png file back to the CDN server along with an optional HTTP header called Time-to-Live (TTL), which indicates how long the picture will be cached.
  4. The picture is returned to User A from the CDN’s cache, where it stays until the TTL runs out.
  5. User B requests the same image by sending a request.
  6. If the TTL hasn’t run out, the picture is retrieved from the CDN.

Thanks for reading. If you loved this article, feel free to hit that follow button so we can stay in touch.

This article is possible because of these references. some external links in this post are affiliate.

Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems

System Design Interview — An insider’s guide

Ngnix load balancer

--

--

Zaid Alissa Almaliki
Zaid Alissa Almaliki

Written by Zaid Alissa Almaliki

Data Engineer, LinkedIn and Twitter Top Voice. Contributing to leading platforms like Towards Data Science.

No responses yet