Edge Functions

Serverless functions at the edge

Deploy Node.js, Python, or Go functions that run at 45+ global points of presence. Sub-millisecond cold starts. Pay only for what you use. No infrastructure to manage.

// index.js — deployed to 45+ PoPs

export default async function handler(req) {

const geo = req.headers.get('cf-ipcountry')

return new Response(

`Hello from ${geo}!`

)

}

// Deployed in 3s. P99 latency: 4ms

45+

Global PoPs

<1ms

Cold start

1M

Free invocations/mo

Supported runtimes

Node.js

Node.js

18, 20

Python

Python

3.9, 3.12

Go

Go

1.21

What you can build

A/B Testing

Run experiments at the edge — no round-trip to origin servers. Split traffic by cookie, geo, or random percentage.

Auth Middleware

Validate JWTs and rewrite requests before they hit your origin. Zero latency overhead on protected routes.

Image Optimisation

Resize, compress, and convert images on-the-fly at 45+ PoPs. Serve WebP to supported browsers automatically.

Personalisation

Inject user-specific content based on geolocation, device, or cookies — without a server round-trip.

Rate Limiting

Block abuse at the edge before it reaches your origin. Define rules in JavaScript, no iptables needed.

Webhooks & Integrations

Process inbound webhooks from Stripe, GitHub, or any third party with zero cold-start latency.