The problem a CDN solves is distance, not computation. Light through fibre is quick but finite, and a request from Auckland to a server in Frankfurt crosses most of the planet before the connection is even agreed, then does it again while the encrypted session is negotiated. No amount of tuning on the origin machine changes that, because nothing is being computed slowly. So the content moves instead. Cloudflare, Fastly, Akamai, Bunny and Amazon CloudFront each run clusters of servers in data centres near population centres, and steer visitors to the nearest healthy one using anycast routing, where many machines announce the same address and the network hands each request to whichever is closest. The first person in a region to ask for a file triggers a fetch from your origin, which the edge then keeps; everybody after that is served locally. Nothing is uploaded anywhere, which regularly surprises people who expect a content delivery network to be a place they put things. It is better understood as a cache you rent in several hundred locations at once, obeying rules your own server sets.
What the edge can and cannot answer
Static files are easy cargo: images, stylesheets, scripts, fonts, video segments. HTML is where judgement is required. A page identical for every visitor can be held at the edge and usually should be, which is how a statically generated site ends up serving nearly every request without its origin waking at all. A page showing a signed-in customer their own name cannot be, and pushing it there anyway means one customer's session is handed to the next visitor in the same region. Two subtler faults appear constantly. A response carrying a Set-Cookie header is normally treated as private, so a single analytics cookie set on the server side can silently switch off edge caching across an entire site. And a Vary header listing too many dimensions splits one stored copy into many, each of which goes cold on its own, so the hit rate collapses without a single error appearing in any log. Purging deserves a thought before launch rather than after: every provider exposes a way to clear a single path, and some let you tag responses so that an entire group of pages can be dropped in one call, which is the difference between an editor seeing their change immediately and an editor refreshing hopefully until the timer expires. Speed is only half the product in any case. A traffic spike on launch day, or a volumetric attack, lands on a global network built to eat exactly that rather than on your web server, and for plenty of sites that absorption is worth more than the milliseconds.
