CDN

A CDN, content delivery network, is a set of servers across regions that cache and serve your files from the closest location. It lowers time to first byte and takes load off your origin. It also serves HTTP/2 and HTTP/3, compresses with Brotli, and often manages TLS and edge redirects.

By , founder of Porteur · Updated 14 September 2026 · Markdown

What it does and what it improves

A CDN caches static assets always, and often the HTML pages. Visitors fetch files from a nearby edge, not your origin.

  • Lower TTFB, because the edge can respond faster than a distant origin.
  • Faster delivery with HTTP/2 and HTTP/3 for multiplexing and fewer connection costs.
  • Smaller transfers with Brotli compression for text files like HTML, CSS and JS.
  • Less origin load, so spikes are absorbed at the edge.
  • Simpler ops: TLS termination and redirects handled at the edge.

Cloudflare, Fastly, Akamai, CloudFront, and the edges on Vercel and Netlify are CDNs. Most hosting platforms include one as of 2026.

Why it matters for a small site

Speed wins signups and sales. A CDN improves Core Web Vitals by lowering server work and moving bytes closer to users.

  • If you have visitors outside your origin’s region, the latency drop is large.
  • If you run on a single small server, the CDN shields it from peaks.
  • If you serve large images, fonts and scripts, the edge handles them efficiently.

For SEO, faster delivery helps real user experience and can support better performance on metrics like LCP and INP. It does not change your content or titles, it just gets them there quicker.

How to check and measure a CDN

  • Check headers in your browser’s network panel. Look for HTTP/2 or HTTP/3, Brotli content-encoding, and cache-control on static assets.
  • Record TTFB by region. Load a page from different locations and note the waiting time for the first byte.
  • Look for cache status. A cached request should show a HIT header from the edge, not a MISS from origin.
  • Verify TLS and redirects at the edge. Visit http and www variants and confirm instant 301s before the origin is touched.
  • Watch origin metrics. Fewer requests should reach the origin after caching is set.

A fixed page looks like this in the network panel: protocol h3, content-encoding br, cache-control long on CSS and JS, and a cache HIT on repeat loads.

Set up a CDN the right way

  1. Enable the CDN on your host or choose a provider

    If you use Vercel, Netlify or a managed host, turn on their edge. Otherwise point your DNS or origin to Cloudflare, Fastly, Akamai or CloudFront.

  2. Cache static assets aggressively

    Set long cache-control for CSS, JS, images and fonts. Use file hashing so updates invalidate safely.

  3. Consider caching HTML

    Cache public pages like /, /pricing and docs. Bypass caching for logged-in users and admin paths. Purge on deploys.

  4. Serve modern protocols and compression

    Enable HTTP/2 and HTTP/3. Turn on Brotli for text. Ensure TLS terminates at the edge with current ciphers.

  5. Move redirects to the edge

    Set canonical host and http to https as edge rules. Avoid chaining redirects through the origin.

Common traps to avoid

  • Caching private pages and showing account data to others. Always vary or bypass cache on auth cookies.
  • Letting query strings or cookies disable caching for everyone. Define clear cache keys and ignore non-essential parameters.
  • Edge redirects that loop or chain. Test all host and scheme variants once the CDN is in place.
  • Multiple hostnames serving the same content. Enforce one canonical host at the edge and redirect the rest.
  • HTML caching that serves stale versions forever. Tie purges to deploys and set sensible max-age.
  • Assuming the CDN fixes everything. Large images, render-blocking scripts and third-party tags still slow pages.

Questions

Sources

Check my site, free

Paste your URL and get a free check that shows if your pages are served from a CDN, how they load against rivals on key searches, and three findings in about thirty seconds.

  • Free check, no card
  • Read-only, your own accounts
  • Readable by your agent

Read next