What a Cloudflare Workers Move Actually Costs, Measured
A Pages-to-Workers move has four cost dimensions. Here is how to measure each one before you commit, and which platform limits decide the answer.
Moving a static site from Cloudflare Pages to Workers buys file headroom, not speed — and the headroom is the only line item with a hard cliff. We ran this exercise on our own migration, and the most useful thing it produced was not a performance win. It was a format: four cost dimensions, each one answerable with a number, a tool and a date. Almost nobody publishes a ledger in that shape, which is why the decision keeps getting argued with adjectives instead of measurements.
So this piece is the ledger format, not our private numbers: what to record in each dimension, how to record it honestly, and where the platform limits actually bind.
Why "what changed" coverage is not enough
We published the decision framework for the Pages-to-Workers move when Cloudflare's own docs started opening by asking whether you were sure you wanted Pages. We covered Node.js compatibility turning on by default for every Worker. We compared Astro and Next.js with real benchmarks. All of that answers what changed. None of it answers the question a technical buyer actually has to take into a budget meeting: what does this cost me, in what dimension, and where does it show up?
A migration has four cost dimensions. If you can fill in all four with numbers, you can defend the decision. If you can only fill in "the docs changed", you are guessing.
| Cost dimension | What it measures | Who feels it |
|---|---|---|
| Toolchain | Build wall-clock, peak memory, CI container limits | Engineers, every commit |
| Artifact | Files and bytes per deployment against the platform cap | Whoever hits the limit at 2 a.m. |
| Request path | Time to first byte, per request class | Every visitor and every crawler |
| Field performance | Core Web Vitals in the browser | Conversion, rankings, patience |
The ledger to build before you move
The mistake is measuring only the dimension you are excited about. Two of these four usually come back flat, one is a cliff, and one is where the real problem hides. Record them in this shape:
| Metric | How to capture it | What a good answer looks like |
|---|---|---|
| Deployment file cap | The platform's own limits page, with the date you read it | Two documented numbers: what you have today, what you are moving to |
| Deployed file count | Count the built output, not the source tree | A count per release, and a delta per release |
| Build wall-clock and peak memory | The same machine that will run the build | Minutes and megabytes you can reproduce on a clean checkout |
| Server response, per request class | One fixed vantage point, cache status recorded per sample | A median per class, not one lucky curl |
| Lab TTFB and field vitals | A lab run you control; field data when traffic allows | A before/after pair from the same tool and settings |
Read that list and notice what it is designed to catch: a migration that changes where bytes are served from, and not the bytes. Our parity check exists for exactly that reason — proving that a served page is byte-identical to its build output apart from the injected analytics beacon. A move that changes delivery and not payload should not move Core Web Vitals. If yours does, something else in the pipeline changed at the same time, and you now have two variables and one incident.
The artifact dimension: the only cliff in the ledger
The file cap is the one line with a hard edge. Cloudflare Pages caps a deployment at 20,000 files. Workers static assets allow 100,000 files per Worker on a paid plan. Those are the only two numbers you need from the vendor — and they are the ones most migration pitches never put in the same sentence.
What matters is your own trajectory. Count the built output on every release, record the delta, and divide the remaining headroom by that delta. The answer comes out in months, which is the unit that actually forces a decision. A site that adds thousands of pages a month can be inside the cap today and out of runway before the next content plan lands; the same site on the larger cap has years instead. That is the honest cost-benefit ratio of the move: you do not move for speed. You move when a documented platform limit becomes the thing standing between you and next quarter's content plan.
Then wire the number into the build so it announces itself in a pull request rather than an outage. A guard that fails the deploy at a fraction of the cap costs a few lines and removes the 2 a.m. version of the same conversation.
The request path: what a Worker in front of everything actually costs
Here is the architectural difference that deserves a number. With run_worker_first, a Worker runs before static assets on every path except the asset prefixes — hashed bundles, images, favicons, robots.txt, llms.txt, rss.xml and the sitemaps. Those skip the Worker entirely. Every HTML page, every redirect, every API route invokes it.
The fair question is what that invocation costs. The honest way to find out from one machine is to compare the two request classes from the same box, minutes apart, with cache status recorded on every sample — Worker-handled HTML against Worker-skipping assets at the same edge. Treat the gap as an upper bound rather than a measurement of the runtime layer: it is not a controlled A/B, the payloads differ, and one datacenter curl is not a field study. What it reliably tells you is the order of magnitude, and the order of magnitude is the point: the runtime layer is not where your milliseconds are going.
One nuance worth stealing: on Pages, function middleware already saw essentially every HTML request. The per-request execution was never free — it was just accounted differently. If you are moving off a platform that already ran server code per request, do not budget for a new cost class. Budget for the audit that confirms which paths still hit it.
The toolchain dimension: where the speedup actually landed
Cloudflare announced tsrs, its Rust port of the TypeScript compiler, built with VoidZero on October 20 — up to 8× faster and about 70% less memory than TypeScript 7.0 at the same number of type-check workers, feeding into the Oxc toolchain rather than forking TypeScript.
That is a genuine engineering feat and it will land in your build minutes, not in your LCP. A faster compiler changes your edit loop. It changes your users' experience only if it changes the bytes you ship, the code on the request path, or the work in the browser. This is the single most common category error we see in migration pitches.
Our own toolchain constraint turned out to be memory, not CPU. A build container does not publish the heap your framework will actually receive, Node derives its default from the machine it finds, and the two numbers diverge quietly — the build passes locally, dies mid-render in CI, and production keeps serving the old version while nobody notices. The fix is not a bigger number borrowed from another machine; it is an explicit, measured ceiling in the build script, sized to the container that runs it. That is the kind of number that never appears in a vendor benchmark and always appears in your incident channel.
How we price a framework decision now
The framework is four lines, and the discipline is that every line needs a tool, a date and a URL:
- Toolchain — wall-clock of the production build, peak memory, and the container limit it has to fit inside. Measure it on the same machine you will build on.
- Artifact — files and bytes in the output directory, next to the platform's documented cap. Headroom in months, not in percentages.
- Request path — median time to first byte per request class, with cache status on every sample, from one fixed vantage point.
- Field performance — Core Web Vitals before and after, from a lab run you control and, when you have the traffic, field data you do not.
If a vendor or a benchmark cannot fill in all four, it is selling you a dimension, not a decision. That is also how we decide which layers of the stack to adopt and which to keep portable — the measurement has to survive the pitch.
None of this is a reason to postpone a build. It is a reason to record your numbers before you change the variable, so that when someone asks what the move cost, you answer with a ledger instead of an adjective. If you are staring at a similar decision and want a second read on the numbers before you commit, that is the conversation we have with clients — start here.
Frequently Asked Questions
Does a faster TypeScript compiler or a new runtime port speed up my product?
No, not by itself. A toolchain change speeds up your build and your edit loop. It only reaches your users if it changes the bytes you ship, the code that runs on the request path, or the rendering work in the browser. Measure those three separately, or you will credit the compiler for work it never did.
What actually moves Core Web Vitals on a static marketing site?
Not the host. On a prerendered site the host decides cache behavior and time to first byte, and that is usually already inside the budget. What moves Core Web Vitals is third-party JavaScript: how many scripts load, how much main-thread work they do, and how heavy your images are. Count your script requests before you blame the platform.



