Glossary

CDN (Content Delivery Network)

A CDN is a set of caching servers spread across many cities. Visitors fetch copies of your files from the nearest one, and only cache misses travel back to your own machine, called the origin.

How does a CDN deliver a page?

You point a hostname such as static.shop.example (or the whole site) at the CDN, usually with a CNAME or by moving DNS to the network. When a browser in Lisbon asks for /img/hero.webp, the request lands on an edge node in or near Lisbon. If that node already holds a fresh copy, it answers straight away. If not, it fetches the file from your origin, stores it according to the cache rules, and serves the next Lisbon visitor from memory or local disk. Your machine sees one request where it would otherwise have seen thousands.

What problems does a CDN solve, and which ones does it leave?

  • Distance: a round trip from Southeast Asia to Phoenix costs well over 150 ms; an edge hit in the same region costs a few. Images, scripts, fonts and video segments benefit most.
  • Outgoing traffic: every byte served by the edge is a byte that does not count against your monthly allowance. That matters most in Singapore, where the allowance is 5 TB rather than 15 TB.
  • Bursts: a sudden spike from a link on a busy forum hits the cache, not your PHP workers.
  • What stays on the origin: logins, carts, search results, API calls with personal data and anything marked private still travel to your server on every request. A CDN does not make slow database queries faster.

What do the main CDN terms mean?

TermMeaning
OriginYour own server, the source of truth for every file
Edge or PoPA caching location run by the CDN close to visitors
Hit ratioShare of requests answered from cache; 90 percent or more is normal for static assets
PurgeTelling the edges to drop a cached object before it expires
Origin shieldA middle cache layer that collapses misses from many edges into one fetch
Cache keyThe parts of a request (host, path, some query strings) that identify a stored copy

How should an origin server send cache headers?

The CDN mostly obeys what your origin says. Versioned assets whose names change on every build can be cached for a year; HTML should be cached briefly or not at all. With nginx, a pair of location blocks covers most sites:

location ~* \.(?:css|js|woff2|webp|avif|svg)$ {
    add_header Cache-Control "public, max-age=31536000, immutable";
    access_log off;
}
location / {
    add_header Cache-Control "public, max-age=60, stale-while-revalidate=300";
    try_files $uri /index.php$is_args$args;
}

Check the result with curl -sI https://shop.example/app.4f1c.js | grep -i cache-control. Any response that sets a cookie should normally be marked private so it never lands in a shared cache. Cache explains the layers between a browser and a disk.

Does a CDN hide or protect the origin?

It helps, but only if you close the side door. Visitors resolve the CDN address, yet anyone who learns your origin IPv4 can still reach it directly. Restrict ports 80 and 443 on the machine to the CDN ranges the provider publishes, and keep SSH limited to your own addresses. Our machines also sit behind edge DDoS filtering on the network, described on Edge DDoS filtering, which handles floods aimed at the address itself.

How do I see whether a request was a cache hit?

Most networks add a response header that reports the cache status, often named X-Cache or something similar, plus an Age header counting seconds since the copy was stored. Request the same asset twice and compare: curl -s -o /dev/null -D - https://static.shop.example/logo.svg | grep -iE '^(age|x-cache)'. A growing Age value means the edge is serving its own copy. On the origin, watch the access log while you do this; a hit never shows up there at all, which is the simplest proof the setup works.

When is a CDN not worth it?

For an internal tool used from one office, an API that returns unique data per request, or a game server speaking UDP, a web CDN adds a hop and saves little. The same goes for a site whose visitors are concentrated near one of our cities: pick that city for the machine and you may get most of the latency gain without another service. Latency has typical numbers.

What does a good origin for a CDN look like?

Fast storage for cache misses, enough RAM to keep hot files in the page cache, and a fat port so that refills after a purge finish quickly. The S1 with 1x 1 TB NVMe and 2x 10 Gbps covers most small shops, while a media library that refills often suits the S11 with 2x 2 TB NVMe. Video streaming and Media servers size larger libraries.

Origin Servers With Fast NVMe Storage

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
S1Intel Xeon E-2276G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$53.32$53.32 (1 month)
S3Intel Xeon E-2356G6 / 1264 GB DDR42x 1 TB NVMe2x 10 Gbps$80.38$80.38 (1 month)
S11Intel Core i9-14900K24 / 32128 GB DDR52x 2 TB NVMe2x 10 Gbps$149.39$149.39 (1 month)
S12Intel Core i9-14900K24 / 32192 GB DDR52x 4 TB NVMe2x 10 Gbps$202.82$202.82 (1 month)

Keep Reading

Cache

Caching at every layer of a server, from CPU L1 to the page cache to application caches, and how each one makes the box faster.

Open

Latency

Why distance sets the floor for ping time, how to estimate round trips between our six cities and how to choose a location.

Open

Outbound traffic allowance

How the 15 TB monthly egress allowance works, what it means per day and per second, and why inbound data costs nothing.

Open

Video streaming

Live and on-demand video with fast ports, NVMe for segments and a clear bitrate-to-terabyte budget per month.

Open

FAQ

Quick Answers

Not always. It pays off when visitors are spread across continents or when static files make up most of your outgoing traffic.

Yes. Requests answered from the edge cache never reach your machine, so they do not count against its monthly outgoing allowance.

You can route them through it, but personal or per-user pages should be marked private and will be fetched from your origin every time.

Allow web ports on the origin only from the address ranges your CDN publishes, and block everything else in the host firewall.

Use versioned file names so new builds get new URLs, or purge the changed paths. HTML with a short max-age refreshes on its own.