«Edge faster» — junior; matcher scope, no Node Buffer, env inlined at build, DB connection storms, per-segment runtime — senior answers.
Разбор
- «Edge is faster» junior. Isolate CPU often slower than Node server. Win = cold-start + geo proximity, не throughput.
- Middleware every matched request, before cache. Broad matcher → auth на every static asset. Scope
config.matcher.
- No
Node Buffer, process.cwd(), dynamic require. Libraries feature-detect Node → wrong branch silently.
- Env vars inlined at build for Edge — runtime-only secrets model differs; check platform.
- Database: raw Postgres under load → thousands isolates → connection exhaustion. HTTP drivers exist for this.
runtime = 'edge' per-segment. Page и API route могут differ; layout runtime не force children.
Итог
Edge interview = latency not CPU + isolate constraints + never raw DB pool on Edge.