Edge Function Execution
Edge function execution describes how a lightweight JavaScript or WASM function runs at a CDN Point of Presence (PoP) — geographically close to the user — to handle request routing, response manipulation, personalization, or authentication without a round trip to the origin server.
Edge function execution describes how a lightweight JavaScript or WASM function runs at a CDN Point of Presence (PoP) — geographically close to the user — to handle request routing, response manipulation, personalization, or authentication without a round trip to the origin server.
What the diagram shows
This sequence diagram follows a request through Client, CDN Edge Node, Edge Function Runtime, and Origin Server.
The flow demonstrates three capabilities edge functions provide:
1. Request interception: the edge node intercepts the inbound request before it reaches origin. The edge function runs and inspects request headers, cookies, and URL. 2. Cache bypass or rewrite: the function can rewrite the URL, modify request headers, or short-circuit with a response from the edge (e.g., serving a cached variant or redirecting based on geolocation). 3. Origin fetch and response manipulation: if the function decides to forward to origin, it can modify the origin response before it reaches the client — injecting headers, transforming HTML, or A/B testing by swapping content.
The diagram also shows the case where the edge function generates a full response directly (e.g., returning a JSON API response or redirect) without contacting origin at all.
Why this matters
Edge functions reduce latency dramatically for personalization and auth logic that previously required a round trip to a centralized origin. Platforms like Cloudflare Workers, Vercel Edge Functions, and Fastly Compute@Edge use V8 isolates instead of containers, achieving sub-millisecond cold starts — a key difference from the Serverless Request Flow model with its container-based cold starts.
For static asset delivery without function logic, see the networking CDN Request Flow. The API Gateway Request Flow covers a similar interception pattern but at the origin infrastructure layer rather than the CDN edge.