{"head":{"title":"What Is a CDN (Content Delivery Network)? | OceanLab","description":"A CDN stores copies of your files on servers around the world so users load them from nearby. What it speeds up, what it costs, an example and mistakes.","canonical":"https://oceanlab.in/glossary/cdn"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"CDN","path":"/glossary/cdn"}],"slug":"cdn","term":"CDN (content delivery network)","aka":["content delivery network"],"category":"Hosting and delivery","short":"A network of servers around the world that keeps copies of your files close to users, so pages and media load faster.","body":[["When a user requests an image, script or page, the CDN serves it from the nearest edge location. If the edge does not have it, it fetches it once from your origin server and caches it for the next user. Rules set how long each file is cached."],["Most CDNs also protect the origin from traffic spikes and attacks, terminate HTTPS and can run small pieces of code at the edge, called an ",{"href":"/glossary/edge-function","text":"edge function"},"."]],"why":["Distance adds delay to every request. A CDN cuts load times for users far from your servers, lowers load on the origin and often reduces ",{"href":"/glossary/egress","text":"egress"}," costs, since many requests never reach your cloud. For media-heavy products it is a large part of the hosting bill."],"example":["A travel app's users are spread across Asia and Europe, but its servers are in one region. Moving images and static files to a CDN cuts page load time for distant users, and the origin now handles mostly API calls."],"inBuild":["We give static files hashed names so they can be cached for a long time, set short or no caching on personalised responses, and keep user data out of cache keys. Large uploads go to ",{"href":"/glossary/object-storage","text":"object storage"}," with the CDN in front."],"mistakes":[["Caching personalised pages, so one user sees another's data."],["No way to purge, so a bad file stays live for hours."],["Forgetting to compress and resize images, which keeps the bandwidth bill high."]],"related":[{"href":"/glossary/edge-function","label":"Edge function","detail":"A small piece of server code that runs on a CDN's servers around the world, close to the user, instead of in one central region."},{"href":"/glossary/egress","label":"Egress (data transfer out)","detail":"Data that leaves a cloud provider's network, such as files sent to users, which many providers bill per gigabyte."},{"href":"/glossary/object-storage","label":"Object storage","detail":"A way of storing files as objects in buckets, each with an ID and metadata, reached over HTTP and built to scale to huge amounts of data cheaply."},{"href":"/glossary/load-balancer","label":"Load balancer","detail":"A service that spreads incoming traffic across several servers, and stops sending traffic to any that fail their health checks."},{"href":"/glossary/pwa","label":"PWA (progressive web app)","detail":"A web app built with standard web technology that can be installed on a device and work offline, giving an experience close to a native app."}],"tools":[],"links":[{"href":"/pricing/categories/cdn","label":"CDN pricing","detail":"CDN and bandwidth prices, with sources."},{"href":"/pricing","label":"Pricing library","detail":"Software and API prices, each with its source and date."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}