A CDN, or content delivery network, is a distributed system of servers that delivers web content from locations geographically closer to users. CDNs reduce latency by caching static assets such as images, scripts, and stylesheets near major population centers. When a user requests content, the CDN routes the request to the nearest edge server rather than the origin server. This improves load times, reduces bandwidth usage, and increases reliability. CDNs are essential for modern websites and applications with global audiences.
how it works
CDNs receive copies of content from an origin server and store them at multiple edge locations. When a user requests a file, DNS resolves the request to the closest edge node. If the file exists in cache, it is returned instantly; otherwise, the CDN fetches it from the origin and stores it for future use. CDNs integrate with caching headers, compression, TLS termination, and DDoS protection. They also provide analytics and traffic routing features. Using a CDN helps offload work from the primary server and improves the user experience.