Node.js Runtime: đầy đủ Node.js APIs, có thể dùng npm packages, phù hợp cho heavy computation.
- Edge Runtime: V8 engine không có Node.js APIs, giới hạn package support, nhưng cực kỳ nhanh (chạy gần user), cold start gần 0.
- Middleware mặc định Edge.
- Route Handlers có thể chọn:
export const runtime = 'edge'hoặc'nodejs'.
Node.js Runtime: full Node.js API access, any npm package can be used, suited for heavy computation.
- Edge Runtime: V8 engine without Node.js APIs, limited package support, but extremely fast (runs close to the user) with near-zero cold starts.
- Middleware uses Edge by default.
- Route Handlers can opt in:
export const runtime = 'edge'or'nodejs'.