- Oct 23, 2026
- 3 min read
Cloudflare Pages Projects Are Now Workers: What Changed for a Static Site
I’ve deployed several static sites to Cloudflare Pages with the same two commands. This time, with wrangler 4.149, the result was different enough to write down.
What happened
npx wrangler pages project create my-site --production-branch main
Instead of a classic Pages project:
- the site was deployed as a Worker with static assets, on
my-site.<account>.workers.dev; - wrangler printed a notice that this is “the latest version of Cloudflare
Pages, now part of Cloudflare Workers”, recommending
wrangler deployfor future deployments, with--forceto get the previous kind of project; - it wrote a
wrangler.jsoncwhosemainpointed atdist/_worker.js/index.js, a file that doesn’t exist in a static build; - it edited my Astro project: added
@astrojs/cloudflare(a server adapter) toastro.config.mjsandpackage.json, plus apublic/.assetsignore.
The site worked, but my static site now had a server adapter it didn’t need.
So is Cloudflare Pages deprecated?
Not in the sense of “stop using it”. What I saw is a change of default:
wrangler now calls Workers with static assets “the latest version of
Cloudflare Pages”, and new projects get that unless you pass --force. My
existing Pages projects kept building and deploying exactly as before, Git
builds and deploy hooks included. The practical question is which kind of
project you’re creating, and whether it adds anything to a static site you
don’t want. The rest of this post is that.
What I reverted
The adapter exists for server-rendered Astro. A fully static site gains nothing from it but a server bundle and complexity, so:
git checkout -- astro.config.mjs package.json package-lock.json
rm public/.assetsignore
Then I rebuilt and checked that dist/ had no _worker.js.
The config that works
{
"name": "my-site",
"main": "worker/index.js", // optional: only for the canonical-host redirect
"compatibility_date": "2026-10-06",
"assets": {
"directory": "dist",
"binding": "ASSETS",
"html_handling": "auto-trailing-slash", // /privacy -> /privacy/
"not_found_handling": "404-page", // without it, unknown paths got a 301
"run_worker_first": true // only needed with the redirect worker
},
"routes": [
{ "pattern": "www.example.com", "custom_domain": true },
{ "pattern": "example.com", "custom_domain": true }
]
}
Without not_found_handling, an unknown path answered with a 301 to a
slash version instead of a 404: the soft-404 problem again, the one that once
hid hundreds of broken links.
_headers from the build still applied, including when the files are served
through the worker.
What it changes for domains
The bigger practical difference: Workers custom domains need the domain’s
DNS on Cloudflare. A classic Pages project could serve a www subdomain
from DNS hosted elsewhere, with a CNAME. Here, the domain moved to Cloudflare
first, keeping its email records, and then the routes above created DNS
records and certificates on deploy
(the full domain checklist is the next post).
Pages or Workers for a static site?
| Classic Pages project | Workers static assets | |
|---|---|---|
| Created by | wrangler pages project create (older), or with --force | wrangler pages project create (4.149), wrangler deploy |
| Config | Dashboard / _headers, _redirects | wrangler.jsonc + _headers, _redirects |
| Logic | Pages Functions | Your own worker script |
| Domain on external DNS | www by CNAME | Not supported: DNS on Cloudflare |
| Fits | Existing projects, external DNS | New projects, everything in one config file |
My existing sites stay as they are. For new ones, the single config file is an improvement, once you know what to remove.
Takeaways
wrangler pages project createmay give you a Worker now. Check what it created.- Read the diff before committing; it edited my project.
- Static sites don’t need the server adapter.
- Set
not_found_handling: "404-page"to keep real 404s. - Custom domains need DNS on Cloudflare; plan the email records first.