Edge Function
ELI5 — The Vibe Check
Edge functions run your code at the CDN edge — meaning close to the user, not in some faraway data center. A user in Tokyo hits your API and it runs on a server in Tokyo. A user in Paris gets a server in Paris. It's serverless functions but geographically distributed. The tradeoff? Limited runtime (no Node.js filesystem, short execution time), but for things like auth, redirects, and personalization, it's blazingly fast.
Real Talk
Edge Functions are serverless compute units that execute at CDN edge locations closest to the requesting user, minimizing network latency. They run in lightweight runtimes (V8 isolates, Deno, or WebAssembly) with fast cold starts (<5ms). Use cases include request routing, A/B testing, authentication, geolocation-based content, and response transformation. Providers include Cloudflare Workers, Vercel Edge Functions, Deno Deploy, and Netlify Edge Functions.
When You'll Hear This
"Put the auth check in an edge function — it runs before the request even hits the origin." / "Edge functions can't do heavy computation, but they're perfect for request transformation."
Related Terms
CDN (Content Delivery Network)
A CDN is a network of servers spread around the world that store copies of your files.
Cloudflare Workers
Workers run JavaScript at the edge — on Cloudflare's network of 300+ data centers worldwide. Your code executes in milliseconds, right next to the user.
Edge Computing
Your server is in Virginia. Your user is in Tokyo. Every request travels 10,000 km and back.
Serverless
Serverless doesn't mean there are no servers — it means YOU don't have to think about servers. Someone else manages them, scales them, and patches them.
Vercel
Vercel is the magic platform that takes your frontend code and puts it on the internet in like 30 seconds.