Skip to main content
Products & Tools

Vercel Expands Request Body Limit for Functions

Vercel Functions now support request bodies up to 20MiB, up from 4.5MB.

By Precis Daily Newsroom1 min read207 words
AI-summarized from the linked source and published automatically — not human-edited.How this works →
Illustration for: Vercel Expands Request Body Limit for Functions
Illustration

What happened

Vercel has increased the maximum size for inbound request bodies in its Functions to 20MiB, up from the previous limit of 4.5MB. This change allows developers to handle larger data payloads in their serverless functions.

To activate this feature, users must set the environment variable VERCEL_SUPPORT_LARGE_REQUEST_BODY=1. This opt-in setting applies to the entire project within the configured environment, enabling testing on preview deployments before moving to production.

Why it matters

The update addresses the growing need for handling larger data transfers in serverless environments. By allowing larger request bodies, developers can now process more complex or larger payloads without encountering size limitations, which can improve application performance and scalability.

Key details

Enabling this feature requires the project's functions to use a performance memory setting of 4GB. The change applies to functions and routing middleware running on Node.js, Python, and Bun runtimes. However, functions and middleware on the Edge runtime remain limited to 4.5MB and return a 413 status code for oversized bodies.

Users must switch to the Node.js runtime with the configuration 'runtime: 'nodejs'', or use proxy.ts in Next.js to take advantage of the larger request body limit. Middleware still processes other request headers, but body-dependent middleware behavior is no longer available.

Sources

Summarized from the linked originals.

Related stories