Skip to main content

Skip sending request bodies to Routing Middleware

By Steven Van ·

The opt-in setting reduces Fast Origin Transfer usage while functions and rewrite targets still receive request bodies.

Requests with large bodies can use less Fast Origin Transfer and may see a faster time to first byte with Vercel’s new skipMiddlewareRequestBody setting.

Keep body processing in functions

The option stops forwarding client request bodies to Routing Middleware. Vercel Functions and rewrite targets still receive the body and can read and process it. Enable it only when your Routing Middleware does not read or access request bodies.

Enable and redeploy

Set skipMiddlewareRequestBody to true in vercel.json, or add the same setting to vercel.ts if your project uses TypeScript configuration. Redeploy the project for the change to take effect. The option defaults to false, so existing projects remain unchanged unless it is enabled.

The configuration documentation explains the setting and recommends processing request bodies in functions or rewrite targets, since reading them in middleware can slow down the application.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Original source

Read Skip sending request bodies to Routing Middleware on Creators Toolbox