Edge function, explained
A normal function runs in one region, so a visitor far from it waits longer. Edge functions run across a global network, which can cut the distance for each request.
They suit small, fast jobs: redirects by country, A/B test assignment, header changes, simple personalisation and checking a login before serving a page.
Cloudflare Workers, Vercel and Netlify all offer versions of this. Edge runtimes can be more limited than a full server, with restrictions on packages or run time, so check each host's docs.
The edge helps less if the code then calls a database in one distant region, because the request still travels there. For heavy work, a regular serverless function near your data is often faster.



