Core Content Delivery Framework

Post by ailswan April. 06, 2026

中文 ↓

🎯 Core Content Delivery Framework

When discussing content delivery and latency optimization, I typically evaluate across three layers:

  1. CDN vs Edge vs Origin Roles
  2. Caching Strategy & Data Freshness
  3. Trade-offs: latency, consistency, and cost

1️⃣ CDN vs Edge vs Origin

CDN (Content Delivery Network)

Definition:

Examples:

Strengths:

Limitations:

Best fit:

CDN is primarily a caching layer. It reduces latency by serving content closer to users and protects origin from high traffic load.


Edge (Edge Compute / Edge Logic)

Definition:

Examples:

Capabilities:

Strengths:

Limitations:

Best fit:

Edge computing extends CDN capabilities. Instead of just caching, we can execute logic close to users, reducing the need to go back to origin.


Origin (Backend / Source of Truth)

Definition:

Examples:

Strengths:

Limitations:

Best fit:

Origin is the source of truth. It provides correctness and full flexibility, but comes with higher latency and cost.


CDN vs Edge vs Origin Summary

Layer Role Latency Flexibility Cost
CDN Cache Lowest Low Low
Edge Lightweight compute Very low Medium Medium
Origin Full backend Highest High High

2️⃣ Caching Strategy & Data Freshness

Cache Hit vs Miss


TTL-based Caching


Cache Invalidation

Strategies:

Cache invalidation is one of the hardest problems. We often trade freshness for performance, especially in high-scale systems.


Stale-While-Revalidate (SWR)

SWR is a practical compromise. It reduces latency while gradually improving freshness.


3️⃣ Trade-offs & System Design Decisions

When to rely heavily on CDN

👉 Example:


When to use Edge

👉 Example:


When to go to Origin

👉 Example:


Hybrid Strategy (Real-world)

Most systems follow this flow:

User → CDN → Edge → Origin

Decision path:

Modern architectures minimize origin calls. The goal is to push as much logic as possible closer to users, while preserving correctness at the origin.


🧠 Senior / Staff-Level Answer

When discussing content delivery, I separate responsibilities across CDN, edge, and origin. CDN handles caching and reduces latency for static or cacheable content. Edge introduces lightweight compute to handle personalization and request logic without hitting origin. Origin remains the source of truth for dynamic and consistent data.

The key trade-off is between latency and correctness. We try to maximize cache hit rate and push logic to the edge, while minimizing expensive origin calls. In practice, most systems adopt a layered approach: CDN for caching, edge for logic, and origin for correctness.


⭐ Staff-Level Insight (Bonus)

The real optimization is not making origin faster — it’s avoiding origin altogether.

Great systems shift work: from origin → edge → cache, until only truly necessary requests reach the backend.



中文部分

🎯 核心框架

在系统设计中讨论 CDN / Edge / Origin,核心是三层职责划分:

  1. CDN(缓存)
  2. Edge(轻计算)
  3. Origin(数据源)

1️⃣ 三层角色

CDN


Edge


Origin


2️⃣ 关键权衡


3️⃣ 实际架构

👉 User → CDN → Edge → Origin


🧠 总结

CDN 解决“快” Edge 解决“更聪明地快” Origin 解决“正确”

Implement