CDN Explained

The global network of edge servers that brings your content closer to users, slashing latency and offloading your origin servers.

CDN

A Content Delivery Network (CDN) is a geographically distributed network of servers that caches and serves content from locations close to end users, reducing latency and improving load times.

Explanation

When a user in Tokyo requests a webpage hosted on a server in Virginia, each request travels across the Pacific Ocean — adding hundreds of milliseconds of latency. A CDN solves this by caching content on edge servers worldwide. The Tokyo user gets served from an edge server in Tokyo, the London user from London, and so on. CDNs handle two types of content: static (images, CSS, JavaScript, fonts — files that rarely change) and dynamic (API responses, personalized content — which requires more sophisticated caching rules). Modern CDNs like Cloudflare, Fastly, and AWS CloudFront also provide edge computing (run code at edge locations), DDoS protection, WAF (web application firewall), and TLS termination. CDN configuration involves setting cache rules (which paths to cache, for how long), origin settings (where to fetch content on cache miss), and purge mechanisms (how to invalidate cached content when it changes). A well-configured CDN can reduce origin server load by 90%+ and cut page load times in half for geographically distributed users.

Bookuvai Implementation

Bookuvai configures CDN infrastructure for every production deployment. Static assets are served through CloudFront or Cloudflare with long cache TTLs and content-hash filenames for instant invalidation on deploy. API responses use shorter TTLs with stale-while-revalidate headers. Our Terraform modules automate CDN provisioning as part of the infrastructure milestone.

Key Facts

  • CDNs can reduce page load times by 50% or more for distant users
  • Edge servers cache content in 200+ locations worldwide
  • Modern CDNs also provide DDoS protection and WAF capabilities
  • Content-hash filenames enable aggressive caching with instant invalidation
  • Stale-while-revalidate serves cached content while refreshing in the background

Related Terms

Frequently Asked Questions

Do I need a CDN for my application?
If your users are geographically distributed, yes. Even for single-region apps, CDNs provide DDoS protection, TLS termination, and reduced origin load. The cost is minimal and the performance gains are significant.
What is the difference between a CDN and a load balancer?
A CDN caches and serves content from edge locations near users. A load balancer distributes traffic across multiple origin servers. They complement each other: CDNs handle cached content, load balancers handle dynamic requests.
How do I invalidate CDN cache?
Use content-hash filenames for static assets (automatic invalidation on deploy), purge API calls for specific URLs, or set appropriate Cache-Control headers with TTLs for time-based expiry.