Last modified: March 23, 2026

This article is written in: πŸ‡ΊπŸ‡Έ

Content Delivery Network

A Content Delivery Network (CDN) is a geographically distributed system of servers that deliver web assets such as images, videos, stylesheets, and scripts to users based on their proximity to the nearest server. By placing cached copies of content at strategic locations around the world, CDNs drastically reduce the round-trip time between a user's browser and the hosting infrastructure. CDNs operate through specialized data centers known as Points of Presence (PoPs), each containing clusters of edge servers that cache and serve content to nearby end-users. Modern CDNs go well beyond static file hosting β€” they also accelerate dynamic content, terminate TLS connections closer to the user, and provide DDoS mitigation at the network edge.

CDN Architecture with PoPs

         +----------+    +----------+    +----------+    +----------+
         |  User A  |    |  User B  |    |  User C  |    |  User D  |
         | (Tokyo)  |    | (Berlin) |    | (NYC)    |    | (Sydney) |
         +----+-----+    +----+-----+    +----+-----+    +----+-----+
              |               |               |               |
              v               v               v               v
        +-----------+   +-----------+   +-----------+   +-----------+
        | PoP Tokyo |   | PoP Frank |   | PoP NYC   |   | PoP Syd   |
        |  (Edge)   |   |  (Edge)   |   |  (Edge)   |   |  (Edge)   |
        +-----+-----+   +-----+-----+   +-----+-----+   +-----+-----+
              |               |               |               |
              +-------+-------+-------+-------+               |
                      |               |                        |
                      v               v                        v
               +-------------+  +-------------+        +-------------+
               | Origin US   |  | Origin EU   |        | Origin APAC |
               +-------------+  +-------------+        +-------------+

How CDNs Work

CDN Routing: DNS vs Anycast

    DNS-Based Routing                          Anycast Routing
    -----------------                          ---------------
    User -> DNS Resolver                       User -> Packet (dst: 203.0.113.1)
              |                                          |
              v                                     BGP selects
         CDN Auth DNS                            shortest AS path
         (checks geo)                                    |
              |                                    +-----+------+
         returns IP of                             |            |
         nearest PoP                            PoP A        PoP B
              |                               (2 hops)     (5 hops)
              v                                  ^
         User -> PoP                             |
                                           packet arrives
                                           at PoP A

Components

Types of Content Delivered

TTL and Cache Headers

Cache Invalidation Strategies

Cache Hit vs Cache Miss Flow

       +--------+        +-------------+
       |  User  +------->|  Edge Server|
       +--------+        +------+------+
                                |
                       +--------+--------+
                       |                 |
                  Cache Hit         Cache Miss
                       |                 |
                       v                 v
                 +-----------+    +-------------+
                 | Serve     |    | Shield /    |
                 | cached    |    | Mid-tier    |
                 | response  |    +------+------+
                 +-----------+           |
                                +--------+--------+
                                |                 |
                           Cache Hit         Cache Miss
                                |                 |
                                v                 v
                          +-----------+    +-----------+
                          | Serve     |    | Fetch from|
                          | cached    |    | Origin    |
                          | response  |    +-----+-----+
                          +-----------+          |
                                                 v
                                          +-----------+
                                          | Cache +   |
                                          | Serve     |
                                          +-----------+

Benefits of CDNs

CDN Features

Performance Metrics

Common CDN Providers

Use Cases

CDN Challenges

Best Practices