Short answer
Edge functions are request handlers a provider runs on its own machines close to the visitor, instead of on one central server. Cloudflare Workers do this with V8 isolates across a global network. Vercel still documents an Edge runtime that runs in the region closest to the request, and it recommends Node.js for new work. A service worker is a different thing: it runs in the browser.
Last verified against the sources listed below.
Key takeaways
- Cloudflare says Workers run on a global network of thousands of machines across hundreds of locations, not on one central server.
- A Worker handles a request in fetch() and returns a Response. Isolates replace a virtual machine per function.
- On the limits page opened in December 2026, Workers Free allows 10 ms of CPU per request and 100,000 requests a day.
- Vercel's Edge runtime page says to migrate to Node.js. Next.js 16.3 no longer supports runtime set to edge.
- MDN's service worker sits in the browser as a proxy. It is not code running on the provider's network.
What are edge functions is a placement question: your code runs on the provider’s machines, near the person who made the request, instead of on one computer you picked in a single building. Cloudflare’s How Workers works page says Workers run on a global network of thousands of machines spread across hundreds of locations. Each machine hosts a runtime that can run thousands of applications.
That is back end work with the server owned by the platform.
Cloud computing is the broader name for renting that kind of capacity. An edge function is the specific case where the platform chooses a nearby machine for the request. It is not a script the browser keeps after the tab closes.
Where does the code actually run?
The code runs in a data center the provider operates, on a runtime shared by many customers. Cloudflare contrasts that with JavaScript on one person’s machine or on a centralized server. A request that reaches your workers.dev subdomain, or a domain Cloudflare manages, invokes the fetch handler in your Worker. You answer by returning a Response.
The handler Cloudflare prints is ordinary JavaScript, the language specified by ECMA-262:
export default {
async fetch(request, env, ctx) {
return new Response("Hello World!");
},
};
Under the handler, the runtime is V8, the engine Cloudflare says Chromium and Node.js also use. V8 supplies isolates: lightweight contexts Cloudflare compares to a sandbox.
One runtime process can hold hundreds or thousands of isolates. Memory inside one isolate is separate from the others.
Because the isolate is created inside an environment that is already running, Cloudflare says this model eliminates the cold starts of the virtual machine model.
Isolates are not permanent. Cloudflare lists eviction for resource limits, a script that looks like it is trying to leave the sandbox, and individual resource limits. The page’s advice follows from that: do not keep mutable state in global scope unless you have planned for the isolate to disappear. Two requests are also not promised to land on the same instance.
How is that different from a server you run?
A traditional server is the centralized machine, or the virtual machine, that Cloudflare uses as the contrast. You pay the startup cost of a runtime per process.
Workers, the page says, pay for the JavaScript runtime once when a container starts, and then run many scripts with little extra overhead. Cloudflare states that any given isolate can start around a hundred times faster than a Node process on a container or virtual machine, and that on startup an isolate uses an order of magnitude less memory.
Those sentences are the vendor’s comparison. They are not a benchmark from this guide. They also do not mean your function is free of limits. CPU, memory, and bundle size are still capped, and the caps are printed on the limits page rather than implied by the word “edge.”
A static file is a third case, and it is not a function. If the thing you need at the edge of the network is only a graphic, you do not need a handler. The SVG to CSS Background (Data URI) tool turns an SVG into a CSS value the page can carry itself.
What limits were on the page in December 2026?
The numbers below are from Cloudflare’s Workers limits page as opened in December 2026. CPU time counts only while the CPU runs your code. Waiting on fetch does not count.
| Limit | Workers Free | Workers Paid |
|---|---|---|
| Requests | 100,000 per day | No daily limit on that row |
| CPU time per HTTP request | 10 ms | 5 minutes, default 30 seconds |
| Memory per isolate | 128 MB | 128 MB |
| Subrequests per invocation | 50 | 10,000 |
| Worker size, uncompressed | 64 MiB | 64 MiB |
| Startup time | 1 second | 1 second |
The paid default of 30 seconds can be raised to 5 minutes, written as 300,000 ms, in Wrangler or the dashboard. There is no compressed-size cap.
Only the uncompressed bundle counts. A Worker must finish parsing and running its top-level code within the 1 second startup limit.
The page says the average Worker uses about 2.2 ms of CPU per request, and that heavier work such as authentication or server-side rendering often uses 10 to 20 ms.
HTTP duration is not the same as CPU. The page says there is no hard duration limit for an HTTP-triggered Worker while the client stays connected. waitUntil can extend work for up to 30 seconds after the response is sent or the client disconnects. Cron triggers, queue consumers, and Durable Object alarms are listed with a 15 minute wall-time limit.
What does Vercel document for its edge runtime?
Vercel still documents an Edge runtime, and the same page tells you to leave it for new work. The Edge runtime docs recommend migrating from edge to Node.js for better performance and reliability.
Both runtimes, that note says, run on Fluid compute with Active CPU pricing. Starting in Next.js 16.3, setting runtime to edge is no longer supported.
Those routes and pages run on Node.js.
While the runtime exists, the default is the region closest to the incoming request. You can set preferred regions.
The function must start sending a response within 25 seconds if it wants to keep streaming, and it may stream for up to 300 seconds. The runtime is built on V8, in isolated environments that do not need a container or a virtual machine.
It offers a subset of Web APIs, including fetch, Request, and Response.
The size cap on that page is after gzip, and it includes your code, imported libraries, and bundled files. Hobby is 1 MB, Pro is 2 MB, and Enterprise is 4 MB.
You cannot read or write the filesystem. eval and new Function are disabled.
WebAssembly.compile from a buffer is disabled. process.env is how you read environment variables.
Fluid compute, which the edge page points at, says it has been enabled by default for new projects as of 23 April 2025. Its runtime list includes Node.js, Python, Edge, Bun, and Rust.
Default duration on the Hobby plan in that table is 300 seconds, with the same 300 second maximum. Pro and Enterprise show a 300 second default and an 800 second maximum.
The page describes cold-start work as something it reduces, through bytecode caching on Node.js 20 and later in production, and through pre-warming. It does not claim the edge runtime has no startup cost.
How is a service worker different?
A service worker runs in the visitor’s browser. An edge function runs on the provider’s network.
MDN describes a service worker as a proxy between the web app, the browser, and the network. It can intercept requests, cache files for offline use, and receive push events.
It has no DOM access. It is not a fetch handler in a Cloudflare data center.
| Edge function | Server you run | Service worker | |
|---|---|---|---|
| Where | Provider machines near the request | A central server, VM, or container | The visitor’s browser |
| Startup story | Cloudflare: isolates avoid VM cold starts | A process or VM starts the runtime | Download, install, then activate |
| What it answers | An HTTP request, with a Response | Whatever you install on that machine | Fetches for pages it controls, including offline cache |
| A printed limit | Workers Free: 10 ms CPU per request | Your host’s own caps | HTTPS only, localhost counted as secure |
Cloudflare also says a single Worker instance can handle concurrent requests on one thread, and that other requests may run while you wait on fetch. Do not assume two visitors share memory.
MDN’s worker never sees that data-center question, because it never leaves the browser. If the requirement is “run this near the user on our platform,” you want the edge runtime or Workers.
If the requirement is “answer this even when the network drops,” you want a service worker. The names share a word.
The machines do not.
Frequently asked questions
Do isolates remove every kind of cold start?
Cloudflare's How Workers works page says an isolate is created inside an existing environment, and that this model eliminates the cold starts of the virtual machine model. The same page says any given isolate can start around a hundred times faster than a Node process on a container or virtual machine, and that isolates use an order of magnitude less memory on startup. Those are Cloudflare's comparisons, not a stopwatch result from this guide.
What is the paid CPU cap on Cloudflare Workers?
The limits page opened in December 2026 says Workers Paid CPU time is 5 minutes, and the default per HTTP request is 30 seconds. You can raise that default to 5 minutes, which the page writes as 300,000 ms, in Wrangler or in the dashboard. CPU time is time the processor spends on your code. Waiting on fetch, KV, or a database does not count. Workers Free stays at 10 ms of CPU per request. Memory is 128 MB per isolate on both plans.
Can an edge function read the disk?
Vercel's Edge runtime page says the runtime is not a Node.js application and not a browser application. Some Node.js APIs are unsupported. The page's example is that you cannot read or write the filesystem. Calling require is not allowed. eval and the Function constructor are disabled. The supported surface includes fetch, Request, Response, and a listed set of Web APIs, plus a short list of Node modules such as buffer and util.
How long may a Vercel Edge response keep streaming?
The Edge runtime page says a function must begin sending a response within 25 seconds to keep streaming past that point, and it can continue streaming for up to 300 seconds. A separate note on the same page says middleware configured with the edge runtime must also begin sending a response within 25 seconds, and may keep streaming after that. The page dates a related platform change: starting in Next.js 16.3, setting runtime to edge is no longer supported, and routes and pages run on Node.js.
Why can't a service worker be the same feature?
MDN says a service worker is an event-driven script registered against an origin and a path. It runs in a worker context, so it has no DOM access and it runs on a different thread from the page. Its jobs include intercepting requests and caching files for offline use. It is available only in secure contexts, with localhost treated as secure for development. None of that is a data center choosing a machine near the visitor.
Sources
- How Workers works · Cloudflare, 2026
- Limits · Cloudflare, 2026
- Edge Runtime · Vercel, 2026
- Fluid compute · Vercel, 2026
- Service Worker API · MDN, 2026
- ECMA-262, The while Statement · Ecma International, 2026