CLOUD CONCEPT

Content Delivery Network

A Content Delivery Network is a distributed network of edge servers that delivers content closer to users, often by caching responses from an origin.

Cloud Concepts Hub →

What is Content Delivery Network

A CDN reduces delivery latency and origin workload by serving reusable content from geographically distributed edge locations. It helps applications handle large audiences and traffic spikes, but its effectiveness depends on cache configuration, content freshness requirements, and origin resilience.

A content delivery network places a distributed delivery layer between clients and an application's origin, such as object storage, a load balancer, or a web server. Requests reach an edge location selected through the provider's routing mechanisms, typically based on network conditions and proximity rather than geographic distance alone. When an eligible response is cached there, the edge can serve it without fetching the content from the origin.

For a cache miss, the CDN retrieves the requested content from an upstream cache or the origin and may store it for subsequent requests. This reduces repeated origin work and long-distance transfers. For example, an online retailer can deliver product images, stylesheets, and JavaScript through a CDN while its application servers handle shopping carts and checkout. During a promotion, repeated requests for the same images are largely absorbed by the delivery layer rather than reaching the application infrastructure.

Cache behavior is controlled through expiration settings, HTTP headers, and CDN-specific policies. The cache key determines which requests share a cached response; it commonly includes the URL path and may include selected query parameters, headers, or cookies. Including unnecessary values fragments the cache and reduces the cache hit ratio. Omitting values that genuinely change a response can serve incorrect content or expose one user's information to another. Personalized pages and authenticated API responses therefore need explicit caching and authorization decisions.

Freshness is a deliberate trade-off. Long time-to-live values reduce origin traffic but allow cached content to remain unchanged longer. Versioned asset names, such as an application bundle containing a build identifier, allow long caching periods without delaying releases. Invalidations can remove cached objects before expiration, but propagation takes time and may incur charges. Sensitive responses should use appropriate cache-control directives and policies that prevent unintended shared caching.

CDNs support resilient architectures by distributing request handling and reducing pressure on origins. Some offer origin failover and configurable stale-content serving when an origin fails. However, a CDN does not automatically make a single-region application highly available. Cache misses, expired content, and uncached operations still depend on functioning origins, so critical applications may also require redundant origin capacity and tested failover. A cold cache after a deployment or invalidation can produce a sudden increase in origin traffic.

Security controls commonly include HTTPS, request filtering, and signed URLs or cookies for restricted downloads. Where supported, restrict origin access so users cannot bypass the CDN's controls. An AWS example is allowing a private S3 origin to be accessed through CloudFront origin access control. Viewer authorization and permission for the CDN to access the origin solve different problems and may both be necessary.

A CDN is not limited to static websites: it can deliver media segments and proxy dynamic HTTP traffic, potentially improving connection handling even when responses are not cached. Nevertheless, it is not equivalent to a general-purpose network accelerator. For exam scenarios, choose a CDN when requirements emphasize HTTP-based content delivery, caching, and origin offload. An accelerator such as AWS Global Accelerator addresses network routing for TCP or UDP applications without caching content. Measure cache hit ratio, origin request rate, latency, errors, and total delivery costs to validate the design rather than assuming every workload benefits equally.

Key aspects of Content Delivery Network

Effective CDN design combines distributed delivery, correct cache keys, controlled freshness, secure access, and origins that remain resilient when caching cannot help.

Distributed edge delivery

Requests are handled through geographically distributed edge locations to reduce network round trips. Routing selects an appropriate edge, which is not necessarily the geographically closest location.

Cache keys and reuse

A cache key defines which requests can reuse the same stored response. Include inputs that change the response, but avoid unnecessary cookies, headers, and query parameters that reduce cache efficiency.

Freshness management

Expiration settings and cache-control policies balance content freshness against origin offload. Use versioned asset names for predictable releases and invalidation when cached content must be removed early.

Origin offload and resilience

Cache hits reduce origin requests and help absorb bursts of demand. Cache misses and uncached operations still require origin capacity, while failover and stale-content behavior must be explicitly designed.

Secure delivery

HTTPS protects content in transit, while signed requests or tokens can restrict viewer access. Restricting direct origin access helps prevent bypass of CDN security controls.

Workload-specific acceleration

Reusable assets and media segments are strong caching candidates; personalized responses require more careful policies. Dynamic HTTP delivery may benefit from optimized connections, but a CDN is not a substitute for a TCP or UDP network accelerator.

Cloud services for Content Delivery Network

CloudFront, Cloud CDN, and Azure Front Door are alternative CDN implementations rather than components that must be deployed together. Each places an edge delivery layer in front of configured origins. In an AWS architecture, CloudFront can serve static paths from a private S3 bucket and forward application paths to an Application Load Balancer. Cache policies determine which responses are reused and which requests reach the origins. Origin access restrictions, redundant application targets, and appropriate authorization complement the CDN; caching alone does not provide application failover or protect private content.

Amazon CloudFront image Amazon CloudFront

CloudFront implements CDN delivery through edge locations, configurable cache behaviors, and integration with AWS and external origins. It supports signed URLs and cookies, origin access control for supported origins, and origin failover for supported request methods.

Open Amazon CloudFront →
Amazon Simple Storage Service image Amazon S3

Amazon S3 commonly acts as a durable origin for assets delivered through a CDN. With CloudFront, a private S3 bucket can use origin access control so viewers retrieve objects through the distribution rather than directly from the bucket.

Open Amazon S3 →