A content delivery network, or CDN, is a distributed group of servers that delivers web files from locations closer to users. A website still has an origin server where its primary content and application logic live, but a CDN places copies of suitable files at edge locations across different cities and networks. When someone requests a page, routing systems direct the request to an appropriate edge server. If that server already has a fresh copy, it can respond without making the user wait for every file to travel from the origin.
Caching is the central mechanism. Website operators define which responses may be stored and for how long using cache rules and HTTP headers. Images, style sheets, JavaScript, downloads, and video segments are common candidates because the same file may be requested many times. The first request at an edge location may produce a cache miss, causing the CDN to retrieve the file from the origin and store it. Later requests can be cache hits and return the local copy. When content changes or expires, the edge checks for a newer version.
Distance matters because Internet communication requires round trips among devices, routers, and networks. A user thousands of miles from an origin server can experience noticeable delay before a page begins loading, especially when many separate requests are involved. An edge server in the same region or at a nearby Internet exchange can reduce that travel time. CDNs also optimize connections, compression, and modern web protocols, so the improvement comes from both proximity and efficient delivery rather than geography alone.
Distribution can improve reliability as well. If one edge location is overloaded or unavailable, traffic can often be directed to another. Cached content may continue to be served during a temporary origin problem, depending on configuration. A CDN also absorbs much of the repeated traffic that would otherwise reach the origin, reducing bandwidth use and server load. Many services add traffic filtering and denial-of-service defenses because their edge network already sits between visitors and the website.
A CDN is not automatically a full replacement for web hosting. Dynamic requests, account actions, database queries, and personalized pages may still need to reach the origin or specialized application servers. Incorrect caching can expose private content or leave an outdated page visible, so operators must define cache keys, expiration, invalidation, and access controls carefully. Performance also depends on where the audience lives, the number and quality of edge locations, and how efficiently requests are routed.
People encounter CDNs whenever a site loads images quickly, a software update comes from a nearby server, or a stream arrives in small cached segments. The technology is largely invisible because the address in the browser may stay the same while DNS and network routing select an edge behind the scenes. The practical idea is simple: keep reusable content near the people requesting it, return to the origin only when necessary, and spread demand across many locations instead of forcing one distant server to do every job. Cache design also determines how quickly changes appear. Operators can purge an old object, give it a short lifetime, or version the file name so a new release has a new cache key. Pages that vary by language, device, login state, or request headers require special care because too many variations reduce cache efficiency, while too few can send the wrong response to a visitor. Measuring hit rate, origin traffic, error rate, and regional latency helps teams tune the network without treating every response as equally cacheable. A well-tuned CDN therefore depends on application knowledge as much as network scale, because speed and correctness must be preserved together.
It commonly stores reusable files such as images, scripts, style sheets, downloads, and video segments at edge servers.
No. The origin still holds primary content and application logic, while the CDN accelerates and protects delivery.
Nearby edge servers shorten network round trips and can serve cached files without contacting the distant origin each time.
Explore more "Explainers"
Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.
