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
kian
kian8mo ago
You can't do infix wildcards unfortunately
Rich
Rich8mo ago
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)
kian
kian8mo ago
Page Rules behave like this with the Cache Level rule so I assume Cache Rules still work according to this matrix.
No description
kian
kian8mo ago
Workers subrequests basically go through Cloudflare again.
Rich
Rich8mo ago
oh interesting
kian
kian8mo ago
No description
kian
kian8mo ago
Looks like they currently don’t but that’s a big and they will soon