Live demo Cache / CDN Pages Functions In the Atlas case file →

The Slowpoke

Slow, repeated renders make global readers wait and hammer your origin. Cloudflare caches the response at the edge, so the first visitor pays the cost once and everyone after gets it instantly.

The pain

Every reader triggers a fresh, expensive render, so pages crawl and origin carries load it never needed to.

The fix

Cache the rendered response at the edge: the first visitor pays once, everyone after is served in single-digit milliseconds.

So what

Faster pages lift conversions and SEO while cutting origin load and compute cost, with no new infrastructure.

Try it

Load the page.

First load is a cache MISS (a ~700ms origin render). Load it again and it's a HIT from the edge cache, in single-digit milliseconds. Purge to feel the slow path again.

Workers Cache API. The rendered at timestamp stays the same on every HIT, proof you're getting the one cached copy, not a re-render.

How it works

Cache the rendered response at the edge so the first visitor pays the cost once and everyone after is instant.

👥
Readers
worldwide
request
Edge cache
Cache API
on MISS
🖥️
Origin render
only on MISS
First hit → MISS (~700ms)
Every hit after → HIT (~5ms)

Add it to your site

~8 lines · no infrastructure
Worker: cache-aside with the Cache API
const cache = caches.default;
let res = await cache.match(request);          // HIT?
if (!res) {
  res = await renderExpensive();               // MISS: pay once
  res.headers.set('Cache-Control', 'public, max-age=60');
  ctx.waitUntil(cache.put(request, res.clone()));
}
return res;
01
Look the request up in the edge cache
02
On MISS, render once and store it with a Cache-Control TTL
03
Serve every subsequent reader the cached copy
Works with:WorkersPages FunctionsCache Rules (no code)

Official Cloudflare docs