Networking And Edge/

Cdn

Lesson overview

Cdn

How CDNs work — edge caching, static asset delivery, cache invalidation, and when to use a CDN vs origin storage.

Stores images Stores html Stores videos

A CDN is a network of servers placed in different locations that stores or delivers content closer to users.

Serve images serve html serve videos serve some API - cached

origin Server

How Data will reach to these Edge Servers

Pull-Based Approach

Push Based Approach

edge server will get the latest data

Problem: - if something changed in origin server it will take some time again

1. TTL - time to live image.png TTL = 1hr 2. Cache Invalidation / Purge -> we delete the image from edge server when we change something in origin server 3. Cache Revalidation : image.png ttl : 1 hr , cr : 30 4. Change Image ID / URL

Multi Layer CDN

Example tools/providers

AWS CloudFront

Companies Highly relying on CDN

Loading Cdn