Skip to content
Performance & Accessibility

Content Delivery Networks: What Actually Works

Distributed servers that hold copies of your content close to the people requesting it.

Marcus Adeyemi Technical Director 2 min read 20 views
Content Delivery Networks: What Actually Works

Why does it matter?

Distance costs latency that no amount of application optimization recovers, and a CDN is usually the largest single improvement available to a geographically spread audience.

What are the numbers?

  • Benefit reduced latency, offloaded origin traffic and often DDoS protection
  • Cache control governed by origin headers unless overridden
  • Invalidation purging, which varies in speed between providers
  • Dynamic content can be cached carefully, or passed through
  • Risk caching personalised responses at the edge

What should I do?

  1. Set cache headers deliberately at the origin
  2. Never cache personalised responses at a shared edge
  3. Know how to purge, and test it before you need it
  4. Serve images and static assets through the CDN
  5. Monitor cache hit ratio as a health measure
What to do and what to avoid with content delivery networks, side by side
Good practice against the usual mistakes, from the sources listed below.

What should I avoid?

Avoid:

  • Caching authenticated responses
  • Relying on the CDN default configuration
  • Purging everything as the routine fix
  • Adding a CDN without adjusting origin cache headers

When should I get help?

Short answer Bring in help when personalised content has been cached publicly, when cache behavior is not understood, or when a CDN must be introduced to a live site.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Performance & Accessibility work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Performance & Accessibility