Dev.Lib
arrow_backBack to Blogs
LEVEL_1010.1June 27, 20261 min read

Edge rendering

Frontend Architecture

Render at CDN edge close to user — lower TTFB, geo-distributed, limited runtime (Workers, Edge Functions).

Summary

Render at CDN edge close to user — lower TTFB, geo-distributed, limited runtime (Workers, Edge Functions). Not full Node — no long CPU, filesystem, some APIs missing. Split: static at edge, dynamic origin, personalize at edge with cookies/headers. Cold start and cache invalidation complexity.

Code example

export default async function handler(request) {
  const geo = request.headers.get('x-vercel-ip-country');
  const html = renderPage({ geo });
  return new Response(html, { headers: { 'Cache-Control': 's-maxage=60' } });
}

Key points

  • Render at CDN edge close to user — lower TTFB, geo-distributed, limited runtime (Workers, Edge Functions).
  • Not full Node — no long CPU, filesystem, some APIs missing.
  • Split: static at edge, dynamic origin, personalize at edge with cookies/headers.
  • Cold start and cache invalidation complexity.

Further reading

Related concepts