CoderBlog
Hosting

Edge Compute in 2026: Cloudflare Workers, Vercel Edge, and the Death of the Region

A working engineer's guide to edge compute in mid-2026 — what the edge is good for, where the regional cloud still wins, and the engineering practices that make edge functions feel right in production.

The "edge" started as a marketing word for a CDN. In 2026, it is something more specific. The edge is a runtime that runs in the same data center that served the cached content for your static site, with cold-starts measured in single-digit milliseconds, with the same primitives as a serverless function in a regional cloud, with the same isolation guarantees as a container, and with a pricing model that is, for many workloads, dramatically cheaper than a regional serverless function. Cloudflare Workers invented the category. Vercel Edge Functions brought it to the JavaScript mainstream. Deno Deploy, Fastly Compute@Edge, and AWS Lambda@Edge are the rest of the production-grade field.

The edge is not the answer to every question. The edge is the answer to some specific questions — the ones where the work is short, the data is local, the latency matters, and the regional round trip is a real cost. This is what those questions look like in 2026, what the engineering practice is for answering them, and the surprising places where the regional cloud is still the right answer.

Cover image: edge compute in 2026

Fig. 01 — The geometry of edge compute: the user, the edge, the origin, the regional cloud. Distance is latency. Edge is close.

What the Edge Actually Is

The edge is a JavaScript (or TypeScript, or WebAssembly) runtime that runs in hundreds of data centers around the world, each one within roughly 20 milliseconds of a meaningful fraction of the Internet's users. The runtime starts a new isolate in under 5 milliseconds. The isolate runs your code. The isolate terminates. The next request starts a new isolate, or reuses a warm one. There is no virtual machine to boot, no operating system to load, no container to start. The cost per request is the CPU time your function actually uses, measured in milliseconds, billed in microdollar units.

The model is the opposite of a regional serverless function. AWS Lambda in us-east-1 runs in a data center in Virginia. A request from Tokyo pays a 150-millisecond round trip to get to Virginia, plus a 50-100-millisecond cold start, plus the function execution time. The total latency is 200-300 milliseconds. The cost is per-invocation plus per-GB-second. The function is a real Linux container, which means it can do anything a container can do, which means it can take 10 seconds to start, which means cold starts are a real engineering problem.

A Cloudflare Worker in the same scenario runs in a data center in Tokyo. The cold start is 5 milliseconds. The execution time is whatever your function takes, usually under 10 milliseconds. The total latency is 20-30 milliseconds. The cost is the execution time, billed in microdollar units. The function is a V8 isolate, which cannot do everything a container can do, which means the constraints shape the design, which means cold starts are not a problem.

The two are not substitutes. The edge is for a different shape of work. But the shape of work that fits the edge is large.

The Workloads Where the Edge Wins

The workloads where the edge is the right answer, ranked by how often I have shipped them in production.

HTML rewriting at the edge. A user requests https://coderblog.in/articles/blazor-united. The request hits the Cloudflare data center nearest them. The data center has the HTML cached. If the cache is fresh, the user gets the HTML in 20 milliseconds. If the cache is stale, the edge function runs, fetches the new HTML from the origin, rewrites the headers, caches the new version, and serves it. The user gets the HTML in 100 milliseconds. The origin serves one request instead of 200. The cost is zero (Cloudflare Workers free tier covers 100,000 requests per day). The user experience is the difference between "I can read this on a phone in a tunnel" and "I cannot read this on a phone in a tunnel."

Authentication at the edge. A user sends a request with a session cookie. The edge function reads the cookie, validates it (a JWT verification, a database lookup, a call to an auth service), and either lets the request through or returns a 401. The validation happens in the data center nearest the user, in under 5 milliseconds, with no round trip to the origin. For sites that have a global audience, this is the difference between a 200-millisecond login flow and a 50-millisecond one.

A/B testing and feature flags at the edge. A user requests a page. The edge function reads a cookie, a header, or a hash of the user ID, decides which variant of the page to serve, and either returns the variant directly (if cached) or forwards the request to the origin with a header indicating the variant. The decision is made in 1-2 milliseconds. The origin serves the request as if the variant had been chosen by the user. The A/B test data is correct, the feature flag is consistent, the cost is zero. There is no JavaScript on the client. There is no race condition. There is no flash of unstyled content.

Image transformation at the edge. A user requests an image with query parameters for size, format, and quality. The edge function takes the original image from the origin or from object storage, transforms it (resize, format conversion, quality adjustment), caches the result, and serves it. The transformation happens once per unique URL. The cache hit rate is usually 80%+. The cost per request is the transformation time on cold cache misses, which is a fraction of a cent.

Personalization at the edge. A user requests a page. The edge function reads a cookie, looks up the user's preferences (from KV storage, from a database, from a call to a personalization service), and rewrites the page to include the user's name, the user's location, the user's preferred content. The personalization happens in 5-20 milliseconds. The page is served from the edge with the personalization baked in. The origin serves one request per unique user, not one request per pageview.

The Workloads Where the Regional Cloud Still Wins

The workloads where you should reach for a regional serverless function, a container, or a VM, not the edge.

Anything that takes more than 30 seconds. Cloudflare Workers has a 30-second wall-time limit (for paid plans) and 15-second CPU-time limit. AWS Lambda has a 15-minute wall-time limit. If your function needs to do a long-running job, the edge is the wrong tool. Use a regional serverless function, a container, or a long-running worker.

Anything that needs more than 128 MB of memory. Cloudflare Workers has a 128 MB memory limit. Vercel Edge Functions has a similar limit. AWS Lambda can be configured with up to 10 GB. If your function loads a large model, a large dataset, or a large library, the edge is the wrong tool. Use a regional function.

Anything that needs a real filesystem. Cloudflare Workers, Vercel Edge Functions, and Deno Deploy do not have a real filesystem. The "filesystem" is a read-only mount of your bundle. If your function needs to read or write files at runtime, the edge is the wrong tool. Use a regional function or a container.

Anything that needs to talk to a database on a private network. Most databases are on private networks. The edge is on the public Internet. The function can talk to a database over the public Internet (with TLS and a connection pool), but the latency is the latency of a public-Internet round trip, which can be 50-200 milliseconds depending on the regions. For latency-sensitive workloads, the right answer is to put the function in the same region as the database. The edge is the wrong tool.

Anything that needs persistent connections. The edge isolates are short-lived. They can keep a connection open to a database for the duration of a single request, but the next request might be in a different isolate in a different data center. If your architecture relies on persistent connections (WebSockets, server-sent events, gRPC streams), the edge is the wrong tool. Use a regional function with a long-lived process.

Anything that needs to process large amounts of data in a single request. The edge is fast for short requests. The edge is not fast for long requests. If your function is downloading a 100 MB file, processing it, and returning a 100 MB result, the edge will time out or run out of memory. The regional cloud is the right tool.

The Engineering Practice for Edge Functions

The practices that will save you a quarter of debugging time when you ship your first edge function.

Keep the function small. The cold start of an edge function is proportional to the size of the bundle. A 50 KB bundle cold-starts in 5 milliseconds. A 500 KB bundle cold-starts in 25 milliseconds. The difference is not about performance, it is about whether your function can handle a traffic spike. Smaller is faster. Smaller is cheaper. Smaller is more reliable.

Use edge-native storage. Cloudflare has KV (eventually consistent key-value store), Durable Objects (strongly consistent stateful objects), and R2 (S3-compatible object storage). AWS has Lambda@Edge with DynamoDB. Vercel has Edge Config and Vercel KV. The right answer is the storage that is hosted in the same data center as the function. A 5-millisecond read from KV is faster than a 50-millisecond read from a database over the public Internet.

Cache aggressively. Every edge request that can be served from cache should be served from cache. The cache is in the same data center as the function. The cache hit is a 1-millisecond lookup. The cache miss is a 50-200-millisecond origin round trip. The right answer is to design the system so that the cache miss is the exception, not the rule.

Use streaming where possible. Cloudflare Workers supports streaming responses. A streaming response is sent to the user as the function generates it, instead of waiting for the function to finish. For HTML pages with server-rendered content, the user sees the first byte in 5 milliseconds and the last byte in 50 milliseconds. For images, the user sees the first byte in 5 milliseconds and the last byte in 100 milliseconds. The perceived latency is dramatically lower than the total latency.

Test for cold starts. A warm function executes in 5 milliseconds. A cold function executes in 50 milliseconds. The difference is the difference between a fast site and a slow site. Test the cold start. Test it under load. The cold start is the worst case. The worst case is what your users see when they hit the site after a quiet period.

Instrument the cold start. A Cloudflare Worker can use the cf-cache-status header, the cf-ray header, and the Workers Analytics API. A Vercel Edge Function can use the Vercel Analytics. A Fastly Compute@Edge function can use the Fastly Real-Time Analytics. The right answer is to look at the cold-start distribution, not the average. The 95th percentile is what your users see.

When to Skip the Edge

The list of cases where the edge is the wrong answer. Be honest about whether any of these apply to you.

  • You are not operating at global scale. If your users are in one region, the edge is overkill. A regional serverless function is faster, cheaper, and easier to operate.
  • You do not care about latency. If your function is called once a day by an internal cron, the edge is wrong. The edge is for latency-sensitive, user-facing work.
  • You need to integrate with a database on a private network. The latency of talking to a private-network database from the edge is the same as the latency of talking to it from a regional function. The edge adds no value. Use the regional function.
  • You need to process large amounts of data. The edge is for short requests. The regional cloud is for long requests. The regional cloud is for large data. Pick the right tool.

For everything else — HTML rewriting, authentication, A/B testing, image transformation, personalization, redirects, header injection, geo-routing, bot detection — the edge in 2026 is the right default. The work is short, the data is local, the latency matters, and the regional round trip is a real cost. The edge is the answer. Use it.

The Shape of What Comes Next

The edge is the future of a meaningful fraction of the HTTP traffic on the public Internet. The fraction is not 100% — the regional cloud will always exist for the workloads the edge cannot do. But the fraction is growing, and the workloads that move to the edge are the latency-sensitive, user-facing, high-volume ones. The workloads that stay in the regional cloud are the long-running, data-intensive, integration-heavy ones. The split is happening in every other part of the stack. The frontend is on the edge. The backend is in the region. The line between them is the edge function.

A small toolkit to get started, if you have not already: install the Wrangler CLI (npm install -g wrangler). Run wrangler init my-edge. Write a function that adds a header to a request. Deploy it with wrangler deploy. Point a route at it. Watch the Cloudflare dashboard. See the requests flow through the edge. The first deploy takes 15 minutes. The tenth deploy takes 2 minutes. The 100th deploy is muscle memory. The edge is yours. The cost is zero, until it is not, and when it is not, the cost is still measured in cents.

Winson Yau

Engineer, writer, and founder of CoderBlog. Building tools and writing about the craft of software from Hong Kong.

Comments

Discuss the article below. Markdown is supported. Sign in with email or GitHub to leave a comment.