Course contentsShow
← System Design
Lesson 125 of 1,9194. Caching StrategiesFree lesson

CDN as Edge Caching Layer

Positioning content delivery networks as the outermost cache layer closest to end users worldwide.

CDN as Edge Caching Layer

What you'll learn: How content delivery networks serve as the outermost cache layer, positioned closest to end users worldwide.

The Outermost Defense

In the caching hierarchy you've been building, the CDN sits at the very edge—literally the first place a request checks before traveling deeper into your infrastructure. Think of a CDN as a chain of convenience stores scattered across neighborhoods, while your origin servers are the distant warehouse. Users grab what they need from the nearest store instead of driving across town.

How CDNs Position Themselves

CDNs deploy servers in hundreds of locations globally called Points of Presence (PoPs). When a user in Tokyo requests your cat photo, the CDN serves it from a Tokyo PoP—not from your server in Virginia. This geographic proximity dramatically reduces latency.

The CDN sits outside your infrastructure entirely. Before requests hit your load balancer, application servers, or even browser cache (for first-time visitors), the CDN intercepts them. This positioning means:

  • Reduced origin load: Most requests never reach your servers
  • Faster response times: Content travels shorter distances
  • Better bandwidth efficiency: Your servers send data once to the CDN, which distributes it thousands of times

What Gets Cached at the Edge

CDNs excel at caching static content: images, videos, CSS, JavaScript, fonts—anything that doesn't change per user. The CDN respects HTTP cache headers (remember browser caching?) to know how long to store items.

The Request Flow

When properly configured: User → CDN (cache hit? serve immediately) → CDN (cache miss? fetch from origin, cache, then serve) → User receives content.

Key Takeaway: CDNs are the first line of defense in your caching strategy, positioned globally at the network edge to serve content from the location nearest to each user, dramatically reducing latency and origin server load.