Course contentsShow
← Cloud and Infrastructure
Lesson 584 of 2,98911. CDN and Edge ComputingFree lesson

Origin Servers and Edge Caching

How CDNs work with origin servers, cache content at the edge, and reduce origin load.

Origin Servers and Edge Caching

What you'll learn: How CDNs work with origin servers, cache content at the edge, and reduce origin load.

The Core Concept

In a CDN, the origin server is your primary server where the original content lives—your application, database, or storage bucket. Edge caching means storing copies of that content at CDN Points of Presence (PoPs) around the world, so users get responses from nearby locations instead of traveling all the way to the origin every time.

Think of it like a library system: the main library (origin server) holds all books, but branch libraries (edge locations) keep popular titles on hand. Most readers get books from their local branch without bothering the main library.

How It Works Together

  1. First Request (Cache Miss): User requests content → Edge location checks its cache → Content not found → Edge fetches from origin → Edge stores copy and serves to user
  2. Subsequent Requests (Cache Hit): User requests same content → Edge serves from local cache → Origin server isn't contacted at all

The edge location keeps content cached based on Time-To-Live (TTL) headers or CDN rules. Static assets (images, CSS, videos) cache well with long TTLs, while dynamic content may have shorter TTLs or bypass caching.

Benefits of Edge Caching

  • Reduced origin load: Most requests served from edge; origin handles only cache misses
  • Faster response times: Content served from geographically closer locations
  • Lower bandwidth costs: Origin sends each file once per edge location, not once per user
  • Origin protection: Shields origin from traffic spikes and DDoS attacks

Key Takeaway: Edge caching stores content copies at CDN PoPs worldwide, serving users from nearby locations and dramatically reducing requests to your origin server—improving speed while cutting costs and load.