How CDNs Deliver Content So Fast | Akshay

Akshay Chavan walks through what happens between a browser and a nearby CDN edge. The video covers points of presence, routing, cache hits and misses, and the caching policies that keep content fresh while cutting load on the origin.

4:33 video4 min readWatch on YouTube

Open a website and its images, JavaScript, fonts and video can appear almost instantly, even when the origin server is thousands of miles away. Akshay Chavan explains why: a content delivery network, or CDN, changes the path a request takes by placing content at edge locations around the world. The video follows a request from the browser to a nearby edge and shows what happens next.

The problem with a distant origin

Start without a CDN. A user requests an asset from an origin on the other side of the country or the world. The request crosses multiple networks before it reaches the server, and the response has to travel back. Even when the origin is fast, physical distance and network hops add round-trip latency. Repeat that path for many assets and many users, and the delay becomes noticeable and the origin carries a heavy load.

Points of presence and edge routing

A CDN adds distributed points of presence, or POPs, between users and the origin. Each POP contains edge infrastructure that can serve cached content, so requests can be handled much closer, in network terms, to where traffic enters the CDN.

When a browser requests a CDN-hosted asset, the CDN's routing system directs the request toward an appropriate edge location. The video says providers can use DNS, anycast, health information, network topology and current conditions to decide. The goal is not simply the geographically closest machine but a healthy edge that can serve the request efficiently. From the application side the URL still looks ordinary: the page references an asset on the CDN host name and the browser makes an HTTPS request.

Cache hits and cache misses

The edge accepts the request and checks whether the object is already cached there. That lookup decides whether the origin has to be involved.

On a cache hit, the edge already has a fresh copy and returns the image, stylesheet, script or video segment directly to the user. The request never goes back to the origin for that object, and that shorter path is one of the biggest reasons repeated delivery feels fast.

On a cache miss, the edge has no usable copy, perhaps because this is the first request at that location or the cached object expired. The edge forwards the request to the origin or another configured upstream and waits. This request pays more of the long-distance cost, but the origin returns the object to the edge, the edge passes it to the user, and if the caching rules allow it, stores a copy. A second user near that edge, requesting the same object while it is still fresh, gets it from cache with no work done by the origin.

Caching policies and freshness

Caching behavior is controlled by policy. An origin can send cache-control headers that tell shared caches whether an object is cacheable and how long it can stay fresh, and a CDN can apply its own configured rules too. Content cannot stay cached forever, so freshness needs a strategy:

  • A time to live (TTL) makes an object expire after a set period.
  • Revalidation asks whether an older copy has changed.
  • Purge or invalidation mechanisms remove content sooner when necessary.

Longer caching improves reuse, but applications also need a plan for updates and stale content. CDNs work especially well for reusable assets such as images, CSS, JavaScript, fonts, downloads and video segments, which can be cached across many edge locations so users in different regions do not all pull the same bytes from one origin.

What a CDN does not do

The video ends with a caveat. Not every request is cacheable. Misses, personalized responses, freshness requirements and origin performance still matter. A CDN reduces expensive long-distance work but does not eliminate the origin, which remains the authoritative source.

Key takeaways

  • Distance and network hops add round-trip latency, even when the origin server is fast.
  • CDNs place points of presence between users and the origin so repeated delivery happens closer to the user.
  • Routing can use DNS, anycast, health information, network topology and current conditions to pick a healthy edge.
  • A cache hit serves a fresh copy from the edge without contacting the origin.
  • A cache miss fetches from the origin, then can store the response for later users.
  • Cache-control headers, TTLs, revalidation and purge rules define how fresh cached content stays.
  • Personalized or uncacheable responses still reach the origin, so a CDN reduces origin load rather than removing it.

Try it yourself

Take one page you know and list its reusable assets: images, stylesheets, scripts and fonts. For each one, decide how long it could safely stay cached and how you would update it if it changed, using the video's framework of route to an edge, serve fresh cache when possible, fetch from the origin when necessary, and reuse that response.

Chapters

  1. 0:00The Problem: Origin Distance and Roundtrip Latency
  2. 0:25Distributed POPs and Smart Edge Routing
  3. 0:50Cache Hits: Serving Content Directly from the Edge
  4. 1:15Cache Misses: Fetching and Reusing Upstream Objects
  5. 1:40Caching Policies: Cache-Control, TTL, and Invalidation
  6. 2:05Summary: Why CDNs Make Global Content Feel Fast
Full transcript(auto-generated, with timestamps)

The Problem: Origin Distance and Roundtrip Latency

[0:00]Hi, I'm Akshay. Open a website and its images, JavaScript, fonts, and video can appear almost instantly, even when the origin server is thousands of miles away. Sending every request all the way to that origin would add network distance and load. A content delivery network changes that path by placing content at edge locations around the world. So, what actually happens between your browser and that nearby edge? Start without a CDN. A user requests an asset from an origin on the other side of the

Distributed POPs and Smart Edge Routing

[0:25]Country or even the world. The request crosses multiple networks before reaching the server, and the response has to travel back. Even when the origin is fast, physical distance and network hops add round-trip latency. Repeat that path for many assets and many users, and the delay becomes noticeable. A content delivery network adds distributed points of presence, or POPs, between users and the origin. Each POP contains edge infrastructure that can serve cached

Cache Hits: Serving Content Directly from the Edge

[0:51]Content. Instead of every user depending on one distant origin, requests can be handled from edge infrastructure much closer in network terms to where the traffic enters the CDN. When the browser requests a CDN-hosted asset, the CDN's routing system directs that request toward an appropriate edge location. Providers can use DNS, anycast, health information, network topology, and current conditions to make that decision. The goal is not simply the

Cache Misses: Fetching and Reusing Upstream Objects

[1:16]Geographically closest machine. It is to reach a healthy edge that can serve the request efficiently. From the application side, the URL can still look ordinary. The page references an asset on the CDN host name, and the browser makes an HTTPS request. The CDN accepts that request at its edge and checks whether the requested object is already cached there. That cache lookup determines whether the origin needs to be involved. On a cache hit, the edge

Caching Policies: Cache-Control, TTL, and Invalidation

[1:42]Already has a fresh copy of the object. It can return the image, stylesheet, script, or video segment directly to the user. The request does not need to travel back to the origin for that object. That shorter path is one of the biggest reasons repeated content delivery can feel so fast. On a cache miss, the edge does not have a usable copy. Maybe this is the first request in that location or the cached object expired. The edge forwards the request

Summary: Why CDNs Make Global Content Feel Fast

[2:06]Toward the origin or another configured upstream and waits for the response. This request pays more of the long-distance cost, but it can prepare the edge for later requests. The origin returns the object to the CDN edge. The edge forwards the response to the user and if the caching rules allow it, stores a copy locally. The first request may therefore be slower than a cache hit, but it turns the edge into a reusable delivery point for later users requesting the same content. Caching behavior is controlled by policy. For example, an origin can send cache control headers that tell shared caches whether an object is cacheable and how long it can remain fresh. A CDN can also apply its own configured rules. The important idea is that content is cached deliberately with freshness and invalidation behavior defined by

Policy. Now a second user near that edge requests the same object while it is still fresh. This time the edge can answer from its cache. The origin does no work for that request and the response travels over a shorter network path. Multiply that by popular assets in many edge locations and origin traffic can drop dramatically. Cached content cannot stay forever without a freshness strategy. A time to live can make an object expire after a configured period. Revalidation can ask whether an older copy changed while purge or invalidation mechanisms can remove content sooner when necessary. Longer caching improves reuse, but applications also need a plan for updates and stale content. CDNs are especially effective for reusable assets, images, CSS, JavaScript, fonts, downloads, and video segments. Popular objects can be cached across many edge locations, so users in

Different regions do not all pull the same bytes from one origin. The CDN absorbs much of that repeated delivery work while the origin remains the authoritative source. So the speed comes from several mechanisms working together. Shorter network paths to edge infrastructure, cache hits that avoid origin round trips, and a distributed network built to deliver content at scale. But, not every request is cacheable. Misses, personalized responses, freshness requirements, and origin performance still matter. A CDN reduces expensive long-distance work. It does not eliminate the origin. The mental model is simple. Route the user to an appropriate edge, serve fresh cached content there when possible, fetch from the origin when necessary, and reuse that response for later requests. By moving repeated delivery closer to users and distributing it across many edge locations, CDNs make global content feel much faster.

More from Humanitarians AI Fellows

Humanitarians AI Lyrical Literacy Project