On the same hostname, a Worker attached to a route runs before a Worker attached to a Custom Domain; the Custom Domain Worker is treated as the origin, so a narrow route (a single path) can serve a separate file without redeploying the main Worker.
I needed to put a few lines of text on my lab site right away, but shipping them meant shipping every change queued up for the whole site. Cloudflare's documentation points to a way round it: on the same hostname, a Worker on a route runs before a Worker on a Custom Domain, so a tiny Worker that owns a single path can serve that file without redeploying the site.
A small file, stuck
The more I work with AI agents, the more small files I need at fixed paths: verification files under /.well-known/, descriptions meant for agents, things no human visitor ever opens. They usually need to go live now, because some outside service is waiting to read them.
In October 2026 I hit exactly that on pw.migurei.ai: a verification file under /.well-known/ had to go up. The main site, meanwhile, had several changes waiting that were not ready to ship. Serving the file from the main Worker meant publishing everything else in the queue along with it.
A few lines of text, stuck behind a full release.
The answer was one paragraph of docs
On 21 October 2026 I read the Cloudflare Workers Custom Domains documentation:
> A Worker running on a Custom Domain is treated as an origin. Any Workers running on routes before your Custom Domain can optionally call the Worker registered on your Custom Domain by issuing fetch(request).
Two things follow:
- The Custom Domain Worker is treated as the origin, the "home server" of that hostname.
- Route Workers sit in front of it. Requests reach them first; they can answer on their own or pass the request down to the main Worker with
fetch(request).
My lab site is set up exactly this way: one main Worker attached to its hostname as a Custom Domain.
How to use it
Create a small Worker and attach it to a route that matches a single path, for example pw.migurei.ai/.well-known/<file-name>. It returns the file and nothing else. Every other path misses the route and goes straight to the main Worker as before.
- The file goes live immediately, whatever the site's release schedule.
- Undoing it is just as easy: delete the route and requests fall back to the main Worker.
- The main Worker does not change at all.
There is one trap if you measure bot traffic, as I do. Requests to that path are answered by the small Worker, so they never pass through the main Worker's logging unless the small Worker forwards them with fetch(request). If you want to know which bots read the file, log in the small Worker itself. Otherwise the file gets read and you never see it.
The broader lesson for site owners: keep machine-readable files apart from page releases. They have a different lifecycle and a different audience.
How sure is this
This is an external-source claim, resting on one passage in Cloudflare's documentation. I have not tried it on my own zone yet, so I cannot say it works smoothly in practice, and I have not confirmed I have the permissions needed to create the route. As the limits section below notes, the documentation covers only the order in which Workers run; it says nothing about which bots will actually read a file you put there.
Sources
What this does not prove
It says nothing about which bots read the file.