Skip to main content

CDN

Content Delivery Network

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/cdn

In short

A CDN is a network of servers spread around the world that stores copies of website content and delivers it to each user from the nearest location.

What is a CDN?

A CDN, or content delivery network, is a group of servers in many locations, often called edge servers or points of presence, that deliver web content to users. Instead of every visitor loading files from one origin server, each visitor gets them from a nearby CDN server, which makes pages load faster.

CDNs work by caching. The first time someone in a region requests a file, such as an image, a JavaScript bundle, or a video segment, the edge server fetches it from the origin and keeps a copy, and later visitors nearby receive that cached copy directly. HTTP headers such as Cache-Control tell the CDN how long each file may be stored.

Think of a CDN like a chain of local warehouses: instead of shipping every order from one central factory, popular products are stocked close to customers so deliveries arrive faster. Beyond speed, CDNs reduce load on the origin server, absorb traffic spikes, help protect against DDoS attacks, and handle HTTPS connections close to the user.

A CDN does not replace your web server or hosting; the origin still holds the original content and runs your application logic. Many modern CDNs also offer edge computing, which runs small pieces of code on the edge servers themselves, blurring the line between a CDN and a serverless platform.

At a glance

Users in three regions each get content from their nearest edge server: the Frankfurt and São Paulo edges already have it cached, while the Singapore edge misses, fetches the file once from the origin server and keeps a copy.fetch once, keep a copycache hitcache misscache hitOrigin serverEdge serverFrankfurtEdge serverSingaporeEdge serverSão PauloUserUserUser
Each user is served from a nearby copy; only a cache miss makes the trip to the origin, and later visitors in that region get the copy.

Key takeaways

  • A CDN serves content from servers close to each user.
  • It works by caching copies of files from the origin server.
  • CDNs reduce latency, lower origin load, and help absorb traffic spikes and attacks.
  • Cache-Control headers control how long content is cached.
  • Many CDNs can also run code at the edge.

Example

Checking whether a file came from the CDN cachebash
# Show only the response headers for a file served through a CDN
curl -I https://cdn.example.com/images/logo.png

# Typical headers in the response:
# cache-control: public, max-age=31536000, immutable  (cache for up to a year)
# age: 3600                                           (seconds spent in the cache)
# x-cache: HIT                                        (served by the edge, not the origin)

Readers ask

Do I need a CDN for my website?

A CDN helps most when your visitors are spread across different regions or your site serves many images, scripts, or videos. Many hosting platforms include a CDN automatically, so you may already be using one.

What is the difference between a CDN and web hosting?

Web hosting stores your site and runs its application code on an origin server. A CDN sits in front of that server and delivers cached copies of the content from locations close to your users.

What is a cache hit in a CDN?

A cache hit means the CDN edge server already had a stored copy of the requested file and served it directly. A cache miss means it had to fetch the file from the origin server first.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings