← Module 07 · System Architecture
MODULE 07 · SYSTEM ARCHITECTURE

CDN

A CDN stores cached copies of content at edge locations closer to users, so repeat requests can travel a shorter network distance.

01 · What is it?

A Content Delivery Network (CDN) is a distributed network that delivers cached content from edge locations near the people requesting it.

The original application or storage location is the origin. The CDN sits in front of that origin, keeps reusable responses for a while, and serves them when the cache is still valid. It can reduce latency and protect the origin from repeated delivery work, but it does not automatically make every request dynamic or personalized.

02 · Think of it like...

Think of the origin as a central warehouse and edge locations as neighborhood pickup points.

The first customer in a neighborhood may cause a package to be brought from the warehouse. Later customers can receive the same popular package locally. The pickup point needs a freshness rule, and private packages should not be left where anyone can collect them.

UserNearby edgeOrigin

03 · What does it do?

Shorter delivery path

Serve cacheable files from a location closer to the user.

Fewer origin reads

Let many users reuse one cached response instead of repeating the origin request.

Traffic absorption

Handle bursts of demand for the same content without sending every request to the application.

Edge controls

Apply TLS, access rules, compression, routing, and other delivery policies at the network edge.

Freshness management

Use TTLs, cache-control headers, versioned URLs, or purges to decide when content changes.

Miss fallback

On a cache miss, fetch from the origin, return the response, and often cache it for the next request.

04 · Where is it used?

CDNs are commonly used for images, CSS, JavaScript bundles, fonts, video segments, software downloads, documentation, and public API responses that are safe to reuse. A CDN can also sit in front of an application for TLS termination and traffic filtering, while dynamic or personalized responses usually need careful cache rules or a pass-through path.

A CDN is most valuable when many users request the same content and the content can be safely reused for those users.

05 · Example

Imagine a global product launch for an online store. The product page's image, font, CSS, and JavaScript bundle are the same for nearly everyone, so the CDN can serve those files from nearby edges. The current inventory and a shopper's cart are user-specific or fast-changing, so the application should fetch them with rules that prevent one shopper's data from being cached for another.

Request path

shop.example/product/42 loads a versioned image and frontend bundle through the CDN. A cache hit returns the edge copy; a miss asks the origin and may populate the edge.

PM decision

Agree on freshness: a product image can be cached for hours, while inventory may need a direct or very short-lived response. Measure cache-hit rate, origin traffic, latency, error rate, and purge time.

PM Perspective: CDN success is not simply “the page is faster.” Define which content is public and reusable, how quickly updates must appear, what happens during a cache miss, and how the team will invalidate an incorrect cached response.

06 · How it connects

A typical request reaches the CDN before the origin. DNS or an application configuration points traffic to the CDN; the CDN checks its cache key and freshness policy; only a miss or pass-through request needs the origin.

UserDNS / CDNEdge cacheOriginResponse

The CDN works alongside object storage for durable source content, a load balancer for application-server routing, and application security controls for private or personalized data.

07 · Do Not Confuse

CDN ≠ Object Storage

Object storage is a durable source for objects. A CDN is a delivery layer that may cache copies of those objects.

CDN ≠ Load Balancer

A load balancer distributes requests to healthy application instances. A CDN can answer from an edge without reaching an instance at all.

CDN ≠ Cache everywhere

A CDN is one kind of distributed cache. A browser cache or Redis cache lives in a different place and serves a different consumer.

CDN ≠ Origin database

A CDN should not replace the system of record or expose private records through a reusable cache response.

08 · Topic Glossary

ENGLISH TERM中文SIMPLE ENGLISH中文小白理解
CDN内容分发网络A network that delivers content from locations close to users.把内容放到离用户更近的网络节点来提供。
Edge Location边缘节点A nearby delivery location where cached content can be served.离用户较近、可以直接提供缓存内容的地点。
Origin源站The original server or storage location for content.内容最初保存或生成的服务器、应用或存储位置。
Cache Hit缓存命中The edge already has a usable copy of the requested content.边缘节点已经有能直接使用的内容副本。
Cache Miss缓存未命中The edge must ask the origin for the requested content.边缘节点没有可用副本,需要去源站取内容。
TTL生存时间How long a cached response may be reused before it is checked again.缓存内容可以放心重复使用多久。
Cache Invalidation缓存失效Removing or bypassing a cached copy before its normal expiry.内容还没自然过期,就主动让旧缓存失效。
Cache Key缓存键The request details used to decide which cached copy matches.用来判断两个请求是否可以共用同一份缓存的条件。

09 · What to Remember

A CDN is a delivery layer: it serves reusable cached copies from edge locations near users, reducing distance and origin work while making freshness, privacy, and invalidation explicit product decisions.

↑