What is a CDN and how does it improve web performance?
Answer
A CDN (Content Delivery Network) is a distributed network of servers that delivers content from the node geographically closest to the user, reducing latency. Instead of all users hitting a single origin server (which might be in one city), CDN edge nodes in hundreds of locations serve cached content locally. Benefits: Reduced TTFB: serving from 50ms away vs 300ms away is a huge difference for LCP. Reduced server load: CDN absorbs most traffic, protecting the origin. Higher availability: geographic redundancy. Better performance globally: users in Asia get fast responses from Asian CDN nodes. What to put on a CDN: all static assets (JS, CSS, images, fonts). Optionally: SSR HTML responses with short TTLs and cache-vary by auth status. Edge computing: modern CDNs (Cloudflare Workers, Vercel Edge, Fastly Compute) can run server-side code at the edge, reducing TTFB for dynamic pages to near-CDN speeds. CDN selection: Cloudflare, Fastly, CloudFront, Akamai for static assets. For Next.js/Remix/SvelteKit apps, platforms like Vercel and Netlify are built-in CDNs.
Previous
What is browser caching and how does it improve performance?
Next
What is the difference between FCP and LCP?