product
Serverless Edge Compute

Middleware

Run code before a request is processed. Modify headers, rewrite paths, or implement authentication logic at the edge with sub-millisecond latency. Optimize delivery without touching your origin.

$ 0.20 USD

/ million invocations

Billed only when middleware executes.

Technical Specifications:

Execution Time

Sub-1ms

Runtime

Edge Light (V8)

Latency Added

< 2ms

Capabilities

Headers, Rewrites, Cookies

Scaling

Instant & Automatic

Works seamlessly with:

Example 3

Example 2

alt_route
Middleware

Product Capabilities

speed

Zero Latency

Execute logic before the cache without adding perceptible latency to the request.

cookies

Dynamic Routing

Rewrite paths and redirect users based on headers

security

Bot Protection

Identify and block automated traffic at the edge before it hits your origin.

Experience

Logic at the Edge

Intercept requests before they hit your cache or origin. Perform authentication, A/B testing, or geo-routing instantly.

  1. Import the 'next' helper from the edge SDK.
  2. Check the request properties, such as the user's country code.
  3. Rewrite the URL path to a localized version based on the geography.

Frequently
bought together

functions
Serverless Edge Compute

Edge Functions

Deploy serverless code that runs closer to your users. Zero cold starts, instant scaling, and support for JavaScript, TypeScript, and WebAssembly. Perfect for dynamic rendering and API routes.

from

$ 0.60 USD

/ million requests

monitoring
Real-time Insight & Analytics

Edge Analytics

Understand your audience with privacy-first analytics. Track page views, unique visitors, and Core Web Vitals directly from the edge, without impacting client-side performance.

from

$ 10.00 USD

/ million events

We use cookies to improve your experience.