deniz.in

Markets

Weather

Loading weather

· via Vercel blog

Vercel's skipMiddlewareRequestBody option skips request bodies in Routing Middleware

Vercel now lets projects stop forwarding client request bodies to Routing Middleware, reducing incoming Fast Origin Transfer usage and improving time to first byte for large requests.

Vercel's skipMiddlewareRequestBody option skips request bodies in Routing Middleware

What Vercel shipped

Vercel has rolled out a new project setting called skipMiddlewareRequestBody that stops client request bodies from being forwarded to Routing Middleware. According to the Vercel changelog, the setting has two practical effects: it lowers incoming Fast Origin Transfer usage tied to middleware invocations, and it can shorten time to first byte, with the clearest gains on requests that carry large bodies.

The motivation here is fairly mechanical. Middleware on Vercel typically runs before application code, handling concerns such as routing decisions, rewrites and redirects. Much of that logic only ever inspects headers, paths, cookies or request metadata — the payload itself is irrelevant. Despite that, the body has been shipped to the middleware step regardless, consuming transfer volume and adding latency that scales with the size of the request.

How to turn it on

The option lives in the project's configuration file. Setting it in vercel. looks like this:

{ "skipMiddlewareRequestBody": true }

Projects that use a TypeScript configuration can declare the same setting in vercel.ts instead, with Vercel's example assuming @vercel/config is installed:

ts import type { VercelConfig } from '@vercel/config/v1';

export const config: VercelConfig = { skipMiddlewareRequestBody: true, };

Vercel notes that a redeploy is required before the change takes effect. The flag defaults to false, so existing projects keep their current behaviour until someone opts in.

The one restriction

There is a single guardrail to keep in mind. According to Vercel, the setting is only safe when Routing Middleware does not read request bodies. Middleware that parses payloads — for validation, transformation or anything else — should leave the flag off, since the body will not be available at that stage.

The body is not discarded, though. Vercel states that Vercel Functions and rewrite targets still receive it in full, so application code further down the pipeline can keep reading and processing request bodies exactly as before. Only the middleware hop is affected by the change.

Why it matters

Requests with large bodies — uploads, JSON-heavy API calls, form submissions with attachments — have been paying a hidden tax: their payloads travel to middleware that frequently ignores them. That cost shows up in two places customers feel directly: Fast Origin Transfer consumption and time to first byte. The new flag removes both when applied correctly.

The rollout is also conservative in a way worth noting. Because the option is opt-in and defaults to false, no existing deployment changes behaviour the moment the feature ships. Teams can check whether their middleware reads bodies, flip the flag, redeploy, and measure the difference before committing to it broadly.

For anyone running Vercel middleware that only inspects routing-related metadata, this is close to a free win: less data movement, lower measured usage and faster responses on exactly the kind of requests where added latency is hardest to hide.

  • #vercel
  • #middleware
  • #performance
  • #serverless
  • #configuration

Related posts