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
kian14mo ago
You can't do infix wildcards unfortunately
Rich
RichOP14mo 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
kian14mo 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
kian14mo ago
Workers subrequests basically go through Cloudflare again.
Rich
RichOP14mo ago
oh interesting
kian
kian14mo ago
No description
kian
kian14mo ago
Looks like they currently don’t but that’s a big and they will soon
Want results from more Discord servers?
Add your server