smaple.tr
Cloud & DevOps

Edge Computing Platforms Compared: Workers, CloudFront, Fastly

Mehmet Kurtipek
July 12, 2026
13 min read
Cloud & DevOps
Edge computing
Cloudflare Workers
AWS CloudFront
Serverless

If you want to run code in a CDN in front of your app, the realistic shortlist is Cloudflare Workers, Amazon CloudFront Functions, Lambda@Edge and Fastly Compute. CloudFront Functions has the lowest compute price and the tightest limits, Lambda@Edge adds Node.js, Python and network access at a higher price, Workers is the most general-purpose of the four, and Fastly Compute is the WebAssembly option for Rust, Go and JavaScript. If your "edge" is a factory floor, a shop or a vehicle, you are comparing a different set of products, covered further down.

Two apps we built for clients run in production on Cloudflare Workers, so that is the platform we know first-hand. The limits and prices below come from each vendor's documentation in October 2026. They change often, so check them again before you commit.

Three things vendors call an edge platform

The word covers three kinds of product that solve different problems, and most confusing comparisons mix them up.

The first is CDN edge compute: small functions that run in a provider's points of presence (POPs) and handle HTTP requests before they reach your origin, or instead of it. The second is cloud infrastructure placed closer to users. You get the same virtual machines, containers and disks you would rent in a cloud region, sited in a metro area or in your own building: AWS Local Zones and Outposts, Azure Local and Google Distributed Cloud belong here. The third is device-edge software that runs on gateways and industrial PCs you own, receives deployments from the cloud and keeps working when the connection drops. AWS IoT Greengrass, Azure IoT Edge and small Kubernetes distributions such as K3s and KubeEdge are the usual names.

Most web and SaaS teams mean the first kind, and that is where the platforms differ most, so we start there.

The four CDN platforms compared

Cloudflare Workers

CloudFront Functions

Lambda@Edge

Fastly Compute

Languages

JavaScript, TypeScript, Python, Rust

JavaScript (restricted runtime)

Node.js, Python

Rust, JavaScript, Go, C++ (compiled to WebAssembly)

Where your code runs

The Cloudflare data center that received the request

CloudFront POPs

CloudFront regional edge caches

Fastly POPs

Time limit

10 ms CPU on Free; 30 s CPU by default, up to 5 min, on Paid

Sub-millisecond

Up to 30 s

50 ms CPU, 2 min total runtime

Memory

128 MB

2 MB

128 MB on viewer triggers, up to 10,240 MB on origin triggers

128 MB heap

Network calls and request body

Yes

No

Yes

Yes (up to 32 backend requests)

List price

$5/month minimum with 10M requests and 30M CPU ms; then $0.30 per million requests and $0.02 per million CPU ms

$0.10 per million invocations

$0.60 per million requests plus $0.00005001 per GB-second

$0.50 per million requests and $0.05 per million vCPU ms in the first paid tier

Free allowance

100,000 requests a day

2 million invocations a month

None

10 million requests and 100 million vCPU ms a month

The figures come from Cloudflare's Workers pricing and limits pages, AWS's comparison of CloudFront Functions and Lambda@Edge and its pay-as-you-go prices, and Fastly's Compute resource limits and pricing. The prices are for the compute only. Workers adds no charge for bandwidth. CloudFront bills its usual request fee and data transfer on top, and Fastly lists bandwidth separately, per GB and region.

Three details in that table matter most. CloudFront Functions cannot make network calls or read the request body, so it can only decide based on the URL, headers, cookies and a small key-value store. Lambda@Edge runs in CloudFront's regional edge caches, a much smaller set of locations than its POPs, so it is less "edge" than the name suggests. And Fastly's 50 ms CPU cap per request is plenty for request handling and tight for anything heavier.

What 50 million requests a month costs

Take 50 million requests a month of light logic such as redirects and header changes. Assume 1 ms of CPU per request on Workers and Fastly, and 5 ms of billed duration at 128 MB on Lambda@Edge. At the list prices above:

  • CloudFront Functions: 48 million billable invocations after the free 2 million, about $4.80.
  • Cloudflare Workers: the $5 minimum covers 10 million requests, 40 million more cost $12, and 20 million CPU ms above the included 30 million add $0.40. About $17.40.
  • Fastly Compute: 40 million requests above the free 10 million cost $20, and 50 million vCPU ms fits inside the free 100 million. About $20.
  • Lambda@Edge: $30 for requests plus about $1.56 for 31,250 GB-seconds of duration. About $31.56.

The CloudFront Functions and Lambda@Edge lines assume the traffic already goes through CloudFront. If it doesn't, add CloudFront's own request fee of $0.012 per 10,000 HTTPS requests in Europe and Türkiye (about $48 for the 40 million above the 10 million free) and data transfer, unless one of its flat-rate plans fits. So CloudFront Functions is the cheap choice when you already pay for CloudFront, and Workers can come out cheapest when you start from nothing. Either way the gap is tens of dollars a month, so the limits in the table usually decide.

Which one we'd pick, and for what

On AWS, use CloudFront Functions for rewrites, redirects, header changes, cache-key cleanup and checking a signed token. AWS lists exactly these use cases, JWT validation included, and at $0.10 per million invocations it has the lowest compute price in the table.

If you are on AWS and the function needs to call another service, read the body or load a library, Lambda@Edge is the AWS answer. Before you reach for it, check whether an ordinary Lambda function or container in the region next to your database, with CloudFront caching in front, would do the same job. It usually would, without Lambda@Edge's quirks: functions must be created in US East (N. Virginia), each version you attach to a distribution is replicated to AWS locations around the world, and there is no free tier.

For a whole web app or API at the edge, or for middleware that needs storage close by, Workers is the most complete of the four, with Cloudflare's own storage products (KV, R2, D1, Durable Objects) next to the code. It is also the one we know from client work: the Next.js site of a property search platform in Finland runs on Workers, and so does the ad attribution and UTM tracking platform we build for a US paid-media agency.

Fastly Compute makes sense if Fastly is already your CDN, or if your team wants to write edge code in Rust or Go. By default it starts a fresh WebAssembly sandbox for every request, which gives clean isolation between requests.

If you are on Vercel, its edge runtime documentation now recommends migrating from edge to Node.js "for improved performance and reliability", and notes that Next.js 16.3 no longer supports runtime = 'edge'. We read that as a correction after a few years of putting everything at the edge.

Your database is still in one region

The usual reason edge code ends up slower than the server it replaced is a database that stayed in one region. Say your user and your edge function are in Istanbul and your database is in Frankfurt. If each trip from the function to the database takes about 50 ms, close to what we measured from Turkey to Frankfurt (see below), a page that runs three queries one after another spends 150 ms waiting. The same code running in Frankfurt pays one trip from the user, around 54 ms in our test, and then a few milliseconds per query inside the region.

So keep at the edge the work that needs no database or can read from a cache: redirects, checks on signed tokens, A/B assignment, geolocation, serving cached pages, collecting tracking events. Leave anything with several sequential queries next to the database. On Workers you can let Cloudflare make that call. Smart Placement, available on every plan but off by default, watches a Worker's traffic and runs it near its backend when that is faster; you turn it on with "placement": { "mode": "smart" } in the Wrangler config. If you know where the database lives, a placement hint such as "region": "aws:eu-central-1" pins the Worker close to that cloud region instead.

Edge runtimes are not Node.js

Workers runs your code in V8 isolates on Cloudflare's own runtime. Many Node.js APIs work behind the nodejs_compat compatibility flag, some do not, and the limits differ from a Node server. Vercel's page linked above lists the gaps in its edge runtime: no filesystem, no require, no eval.

The failures tend to show up in libraries you did not write. One example: Workers caps the PBKDF2 iteration count in its crypto APIs, and the cap sits below the count OWASP currently recommends for PBKDF2-SHA256. A password library that follows OWASP works in local Node.js and fails at login once deployed to Workers, with an error that starts Pbkdf2 failed: iteration counts above. If the library catches that error, users only see a failed login. Run your tests against a deployed preview as well as locally, and keep auth, crypto and image processing in a regional service if their libraries lean on Node internals.

It also helps to know where your code actually runs. In a Worker, request.cf tells you which data center handled the request:

export default {
  async fetch(request) {
    const { colo, country } = request.cf ?? {};
    return Response.json({ colo, country });
  },
};

Add the same two fields to your request logs for a day and you have a map of where your users are really served from.

A latency check from Turkey

On 18 October 2026 we measured the TCP handshake time, which is about one network round trip, from a single internet connection in Turkey to five endpoints. Each figure is the median of nine connections.

Endpoint

Answered from

Median handshake

Amazon CloudFront

Istanbul POP

~20 ms

AWS Europe (Frankfurt) region

Frankfurt

~54 ms

Fastly

Amsterdam POP

~55 ms

Cloudflare

Amsterdam data center

~57 ms

AWS US East (N. Virginia) region

Virginia

~137 ms

CloudFront answered from Istanbul. Cloudflare has data centers in Turkey, yet our requests went to Amsterdam and came back no faster than AWS's Frankfurt region. Fastly also answered from Amsterdam. Which data center serves a user depends on how their internet provider connects to the CDN, and another Turkish provider could show the opposite result, so a POP map tells you little until you have measured from your users' networks.

You can repeat the check in a minute. The loop prints nine handshake times, fastest first, and the last two commands show which Cloudflare data center and which CloudFront POP answered:

url="https://www.cloudflare.com/cdn-cgi/trace"
for i in 1 2 3 4 5 6 7 8 9; do
  curl -s -o /dev/null -w '%{time_namelookup} %{time_connect}\n' "$url"
done | awk '{ printf "%.1f ms\n", ($2 - $1) * 1000 }' | sort -n

curl -s https://www.cloudflare.com/cdn-cgi/trace | grep -E '^(colo|loc)='
curl -sI https://d1.awsstatic.com/ | grep -i x-amz-cf-pop

Swap in your own domain and your origin's address, and run it from the networks your users are on: home broadband, mobile data, office lines.

Beyond the CDN: local zones and the device edge

AWS opened a Local Zone in Istanbul on 20 May 2026 (eu-central-1-ist-1a, attached to the Frankfurt region), with EC2 C7i, M7i and R7i instances, EBS, ECS, EKS and Application Load Balancer. This is the option when you need a full server in the country, such as a game server, a low-latency trading engine or data that has to stay in Turkey. A CDN function will not do that job.

Outposts, Azure Local and Google Distributed Cloud put the provider's hardware in your own data center. They fit when data must not leave a site and you still want the cloud provider's APIs and tooling. Expect a hardware commitment and a sales conversation, with nothing like per-request pricing.

For gateways and machines you own, the main options are AWS IoT Greengrass (AWS ended support for version 1 on 7 October 2026, so new work is on version 2), Azure IoT Edge (1.6 LTS is current and 1.5 LTS support ends on 10 November 2026), and Kubernetes on small machines: K3s for a lightweight cluster, or KubeEdge, a CNCF graduated project built for nodes that lose contact with the control plane. If you already deploy with containers, our notes on Docker and Kubernetes carry over, and sensor data usually ends up in a time-series database once it reaches the cloud.

We have not shipped device-edge projects, so we won't rank these. The questions we would put to any of them: how an update reaches 500 devices and how you roll it back, what keeps running when a device is offline for a day, and how a stolen or replaced device loses its access.

How to decide

  1. Measure the round trip from your users' networks to the region you use today, with the script above or real-user monitoring.
  2. Write a latency budget for each kind of request: page HTML, API calls, tracking beacons.
  3. Move only the steps that need no database round trip or can be answered from a cache.
  4. Choose the platform by its limits first and its price second.
  5. Test on the deployed runtime before you move auth, crypto or image code.

If the measurement shows your users are already a few tens of milliseconds from your region, CDN caching in front of one well-chosen region is usually all you need. Our AWS architecture notes cover choosing that region.

Frequently asked questions

Is a CDN a form of edge computing?

Yes, the oldest one. Caching files in POPs near users is edge computing without your own code. Edge compute platforms let you run your code in those same POPs.

Can edge code be kept inside one country or the EU?

Not by default. A Worker or a CloudFront Function runs wherever the request lands, which in our test from Turkey was Amsterdam for Cloudflare. Cloudflare's Regional Services, an Enterprise add-on, limits TLS termination and Workers execution to data centers in a region you choose, with the European Union and Turkey among the options. On AWS, the usual way is to run the processing in a specific region or Local Zone and keep only caching at the edge.

Does a small SaaS need edge computing?

Usually not. A single region close to most of your users, with static assets and cacheable pages behind a CDN, covers most SaaS products. Edge functions earn their place for specific jobs such as redirects, token checks and tracking endpoints.

If you are weighing a move to Workers or another edge runtime, our web development team can measure your request paths with you first.

Related Articles

July 21, 2026

AWS Cloud Architecture: A Practical Blueprint and What It Costs

The AWS setup we would suggest for most web apps and SaaS products, layer by layer: accounts, network, compute, data and operations, with October 2026 prices for Frankfurt.

Read More: AWS Cloud Architecture: A Practical Blueprint and What It Costs
July 20, 2026

Cloud Migration Strategy: How to Pick the Right R for Each App

Choose one of the 7 Rs per application, map what each system talks to, move in waves, rehearse the rollback and budget for the costs most migration plans leave out.

Read More: Cloud Migration Strategy: How to Pick the Right R for Each App
July 18, 2026

AWS Cost Optimization: What to Fix First, and What It Saves

The order matters more than any single trick: clean up, rightsize and move to Graviton before you buy Savings Plans. Worked examples use AWS list prices from October 2026.

Read More: AWS Cost Optimization: What to Fix First, and What It Saves