Is it possible to route URLs ending in `/data/` to a worker, i.e. `https://example.com/*/data/`?
We want to do some custom processing on URLs which end in
/data/
within a worker.
e.g.
POST https://example.com/foo/data/
POST https://example.com/foo/bar/data/
etc.7 Replies
You can't do infix wildcards unfortunately
I thought as much, thanks ☹️
Am I right in saying requests routed to a worker which are passed directly into
fetch(request)
would miss out on all of the Cache Rules we have setup? i.e. fetch
will always go straight to origin?
(I'm wondering whether we can do the URL routing in the worker directly)Page Rules behave like this with the Cache Level rule so I assume Cache Rules still work according to this matrix.
Workers subrequests basically go through Cloudflare again.
oh interesting
Looks like they currently don’t but that’s a big and they will soon