Cdn (content delivery network)
A Content Delivery Network is a system of servers distributed across multiple geographic locations that work together to deliver content quickly to users. Instead of every user fetching content from a single origin server (which might be on another continent), a CDN serves content from an "edge" server geographically close to each user. This reduces the physical distance data travels, dramatically improving load times.
Why it matters
Geography creates latency. A user in Tokyo requesting content from a server in New York waits for data to travel around the world - twice (request and response). Light through fiber optic cables takes about 70 milliseconds for that round trip, and that's before server processing. For a page requiring dozens of resources, these delays compound.
CDNs matter because they collapse this distance. With edge servers in Tokyo, that same user gets content from nearby, cutting latency from 70+ milliseconds to single digits. Multiply this across all page resources and all users globally, and the performance impact is substantial.
Beyond performance, CDNs provide resilience. If one server fails, others continue serving traffic. If a region experiences problems, traffic routes around it. This distributed architecture improves both speed and reliability.
How cdns work
The basic CDN flow:
User requests content. A browser requests an image, script, or page from your domain.
DNS routes to CDN. Your DNS configuration directs requests to the CDN rather than your origin server.
CDN selects edge server. The CDN routes the request to an edge server close to the user, typically based on geographic proximity and server health.
Edge server checks cache. If the requested content is cached locally and still fresh, the edge server returns it immediately.
Cache miss fetches from origin. If content isn't cached, the edge server fetches it from your origin server, caches it, and returns it to the user.
Subsequent requests hit cache. Other users in that region get cached content directly from the edge server.
What cdns deliver
CDNs excel at delivering certain content types:
Static assets. Images, JavaScript files, CSS stylesheets, fonts - content that doesn't change per-user. This is the primary CDN use case.
Video and media. Large files that would strain origin servers and suffer from latency. CDNs often support streaming-specific features.
Software downloads. Application installers, updates, and patches. CDNs handle burst traffic during releases.
Dynamic content. Modern CDNs can cache some dynamic content using cache keys based on headers, cookies, or query parameters.
API responses. Cacheable API responses benefit from edge delivery, though cache invalidation requires care.
Cdn benefits
Faster load times. Content from nearby servers arrives faster than content from distant servers. This is the primary benefit.
Reduced origin load. When CDN edge servers handle most requests, origin servers handle dramatically less traffic. This reduces infrastructure costs and improves origin reliability.
Better availability. CDN networks are designed for redundancy. Multiple paths to content mean single points of failure don't cause outages.
DDoS protection. CDN infrastructure absorbs attack traffic across distributed servers rather than letting it overwhelm a single origin.
Global scalability. Serving users worldwide doesn't require building infrastructure worldwide. The CDN provides global presence.
Cdn considerations
Cache invalidation. When content changes, cached copies need updating. CDNs offer purge mechanisms, but invalidation propagating globally takes time.
Cache headers. Proper cache control headers tell CDNs what to cache and for how long. Misconfigured headers cause staleness or cache misses.
Dynamic content limits. Highly personalized or real-time content can't be cached effectively. CDNs help less when every request needs fresh server computation.
Cost structure. CDN pricing typically scales with bandwidth usage. High-traffic applications see significant costs, though usually less than equivalent origin infrastructure.
Security configuration. CDNs sit between users and your origin. Proper HTTPS configuration, origin protection, and access control require attention.
Choosing a cdn
CDN selection factors include:
Geographic coverage. Does the CDN have edge locations where your users are? Coverage varies significantly between providers.
Performance. Not all CDNs perform equally. Test actual latency from your key user locations.
Features. Some applications need specific features: WebSocket support, edge compute, video transcoding, or specific security capabilities.
Integration. How easily does the CDN integrate with your infrastructure and deployment pipeline?
Cost. Pricing models vary - bandwidth-based, request-based, or flat-rate. Model your expected usage.
Major CDN providers include Cloudflare, AWS CloudFront, Fastly, Akamai, and Google Cloud CDN, each with different strengths.
Cdn for product teams
Product managers encounter CDN considerations in several contexts:
Performance requirements. Page speed goals often require CDN usage. Understanding CDN capabilities helps set realistic targets.
Global launch planning. Launching in new regions goes smoother when CDN edge servers are present there.
Cost planning. Traffic growth affects CDN costs. Viral features or marketing campaigns can cause unexpected bills.
Incident response. CDN configuration problems can cause widespread outages. Understanding CDN role in the stack helps diagnose issues.
Tools like Klero help product teams understand how performance affects users. When customer feedback highlights slow experiences in specific regions, CDN coverage gaps might be the cause.

