Skip to content

Edge Middleware is now GA. Learn more

at the edge

Customers expect performance. Businesses require personalization. With Edge Middleware, developers can deliver both.

Better performance

Less code shipped to the browser means better performance on any network.

No configuration

Define your application's global infrastructure directly from your code.

Any framework

Develop, preview, and ship to the edge with any framework.

edge middleware

Dynamic at the speed of static

Edge Middleware gives you the ability to deliver dynamic, personalized content without sacrificing end-user performance.

How edge middleware works

Middleware is designed to run before serving requests from the edge cache, to enable instant rewrites and redirects.

Vercel Edge Middleware is automatically configured as a special edge function that is deployed globally with zero cold boots.

Learn more

Get started with Edge Middleware


Fast, flexible personalization

A/B testing and Feature Flags

The first impressions of a site are made in the first 50 milliseconds of viewing. With Edge Middleware, users will only see what you want them to see.


Safely pre-deploy multiple versions of your site and route users to the correct version at runtime—without any delays.

code example

A/B Testing with Split

Use Split to run A/B tests on your server.

Uses Next.js and Split


Full routing & access control

Bot Protection

Prevent unwanted traffic spikes and protect against attacks by using integrations with bot detection, like DataDome, that allow you to check who is visiting your site.


With simple authentication from a single route, you can check for cookies and perform rewrites at the edge, always ensuring you’re sending users to the correct version of the page.

code example

DataDome Bot Protection

Real-time security protections at the edge with DataDome.

Uses Next.js and DataDome

“We’re excited to leverage Vercel platform features like Edge Middleware that will allow us to continue delivering delightful experiences on the web with the same level of performance that our customers have come to expect of our products.”

Dylan Staley

Software Engineer, HashiCorp

edge functions

Build at the edge

The future of the Web is edge-first—and we’re working to bring that infrastructure and granular access to edge primitives, to all frameworks.

Powered by the Edge Runtime

Vercel is working with partners from across the industry to develop open standards for Edge Compute, and provide everyone with the tools to build for the future of web infrastructure.

Learn more

Edge API Routes for Next.js


Build and deploy powerful APIs to decrease latency for data fetching at the edge.

Edge Functions for all frameworks


Leverage dynamic data-fetching capabilities with your framework of choice.

code example

Authenticated Proxy at the Edge

An authentication proxy demo on Vercel Edge Functions.

Uses Next.js

“We can show the control or experiment version of a page immediately instead of using third-party scripts. This results in better performance and removes the likelihood of flickering/layout shifts.”

Jillian Anderson Slate

Software Engineer, SumUp


Unlock the potential of edge computing

From authentication to feature-flagging, explore the possibilities of the edge and deploy in seconds

Hello World Edge

A classic Hello World for the edge.

Cache Control Edge

Cache control for the edge.

Authentication Proxy

An auth proxy on the edge.

Google Optimize A/B Testing

Google Optimize experiments at the edge

Simple A/B Testing

Run A/B tests from the server-side

API Rate Limiting With Keys

IP blocking and rate limiting using API keys

API Rate Limiting

Use Upstash to rate limit your API at the edge

Basic Auth

Password protection for your pages using edge middleware

JSON Response Edge

A JSON response on the edge.


The development platform for the best frontend teams.