With the release of Next.js 16, the way we handle request delegation has shifted from monolithic middleware toward more granular Proxy Patterns. While middleware is excellent for authentication and bot detection, using it for heavy request rewriting often leads to "Middleware Bloat" and increased cold-start latency.
The Middleware Conflict
In complex applications, a single middleware.ts file often becomes a bottleneck. When multiple routes require different rewriting logic—especially in internationalized (i18n) setups—logic branching becomes hard to maintain.
Localized Proxies: Moving proxy logic closer to the route segment reduces the execution overhead for unrelated routes.
Edge Compatibility: Modern proxies must remain lightweight to run within the restricted environment of Edge Runtimes without pulling in heavy Node.js dependencies.