Prompt
I need edge functions that can inspect headers and route traffic
Latest observation
Oct 26, 2026
OpenAI APIWeb search: off
Yes — edge functions are a good fit for that.
They can:
- inspect incoming request headers
- make routing decisions at the edge
- rewrite URLs or redirect requests
- forward traffic to different origins/services based on rules
Typical examples:
- route mobile vs desktop traffic using
User-Agent - send requests with a specific
X-Tenantheader to a tenant-specific backend - block or challenge requests with missing auth headers
- A/B test traffic based on cookies or custom headers
If you want, I can help with one of these next:
- a generic edge-function example for header-based routing
- a specific implementation for a platform like Cloudflare Workers, Vercel Edge Functions, or AWS Lambda@Edge
- a routing rule design based on your headers and destinations