The answer. In 2024 Pages was the way to host a site and Workers were for code. That has flipped. A Worker with assets.directory serves files for free exactly as Pages does, and adds what Pages lacks: Durable Objects, Cron Triggers, Queues consumers, Workers Logs and traces, gradual deployments, unlimited named environments instead of preview/production, and run_worker_first middleware. Cloudflare's own guidance is now "start new projects with Workers"; Pages keeps working and still has its Git-integrated build UI, but new features land on Workers. Migrating an existing Pages project is mostly renaming pages_build_output_dir to assets.directory and, if you have a functions/ folder, letting Wrangler compile it into a Worker.
The pattern.
// before (Pages) // after (Workers with static assets)
{ "name": "site", { "name": "site",
"pages_build_output_dir": "./dist" } "compatibility_date": "2026-09-01",
"assets": { "directory": "./dist", "not_found_handling": "404-page" } }
npx wrangler deploy # asset-only Worker: no main, no invocation charges
npx wrangler pages project delete site # only after traffic has moved and the custom domain is re-pointed
Watch out.
- Pages preview deployments are branch-keyed; Workers get that through Workers Builds' non-production branch builds, with less configurability.
- Workers custom domains require Cloudflare-managed nameservers; Pages accepted external DNS.
- The
_headersand_redirectsfiles are honored by Workers static assets too, so a migration does not lose them.
Related: static-assets-run-worker-first-decides-who-answers · pages-production-branch-not-main-alias-url-tell · pages-functions-file-routing-and-middleware