👋
Welcome to my blog!

Content Delivery Network

Understand the mechanics of a Content Delivery Network and its role in delivering content at lightning speeds.

Content Delivery Network
System Design
Infrastructure

Published At

7/13/2022

Reading Time

~ 2 min read

CDN is a network of geographically dispersed servers used to deliver static content. CDN servers cache static content like images, videos, CSS, JS files, etc.

Dynamic Content Cache: It enables the caching of HTML pages based on request path, query strings, cookies, and request headers.

How it works:

When a user visits a website, a CDN server closest will deliver static content.

Considerations of using CDN

  1. Cost: Since third parties run it, it will cost you.
  2. Setting upon appropriate cache expiry, not too long, not too short.
  3. CDN fallback: If CDN fails/outrages, the client side should be able to detect the problem and request resources from the origin.

Invalidating files

You can remove a file from CDN before it expires by following operations:

  1. By using API provided by the vendor
  2. By using object versioning to serve a different version of the object, we can add parameters to the URL, such as version number.
  3. Web servers no longer serve static assets (JS, CSS, images, etc.). They are fetched from the CDN for better performances.
  4. The caching data lightens database load.

🫐

Do you have any questions, or simply wish to contact me privately? Don't hesitate to shoot me a DM on Twitter.

Have a wonderful day.
Abhishek 🙏

Join My Exclusive Newsletter Community

Step into a world where creativity intersects with technology. By subscribing, you'll get a front-row seat to my latest musings, full-stack development resources, and exclusive previews of future posts. Each email is a crafted experience that includes:

  • In-depth looks at my covert projects and musings to ignite your imagination.
  • Handpicked frontend development resources and current explorations, aimed at expanding your developer toolkit.
  • A monthly infusion of inspiration with my personal selection of quotes, books, and music.

Embrace the confluence of words and wonder, curated thoughtfully and sent straight to your inbox.

No fluff. Just the highest caliber of ideas.