Edge function
An edge function executes at the CDN's edge locations close to the user — typically with sub-millisecond cold starts (V8 isolates) and ~10-50ms latency advantage vs origin-region functions. Examples: Cloudflare Workers, Vercel Edge Functions, AWS Lambda@Edge, Netlify Edge Functions. Best for request modification, A/B routing, auth gating, and lightweight personalisation.
Edge functions trade compute power and runtime API surface for proximity and start-up speed. Most edge runtimes run V8 isolates with Web APIs (fetch, Request, Response, Headers, crypto) and exclude Node.js APIs that depend on the filesystem or large native bindings. The strongest fit is request-path work that needs to be fast and lightweight: cookie inspection, geo-based routing, auth token validation, edge-cached personalisation. The wrong fit: heavy CPU work (image transforms, ML inference) where the runtime limits bite. Vercel and Cloudflare have pushed the runtime envelope significantly, but the basic trade-off — speed and ubiquity vs runtime depth — still holds.
Related terms
- Serverless
Serverless is the cloud-computing model in which the cloud provider runs and scales the underlying infrastructure transparently — the developer deploys code (functions, containers) and the provider handles servers, capacity, and most operational concerns.
- CDN edge
A CDN edge is one of the geographically distributed points-of-presence operated by a content delivery network — typically hundreds of locations worldwide where static and cacheable content is served from the location closest to the user.
- Function as a service (FaaS)
Function as a Service is the serverless compute model where the deployment unit is a single function with a defined entry point — the provider invokes it in response to events (HTTP request, queue message, scheduled timer) and bills per millisecond of execution.