We have a cost-minded use case where we need to serve a path (without query string) directly from Cloudflare’s CDN cache, and to serve that same path (with query string) from a Workers script.
I haven’t yet found a way to avoid Workers when there’s no query string.
What we need/expect is:
example.com/path -> <no script> example.com/path* -> worker-script
In the Cloudflare Workers UI we have Workers disabled on the
example.com/path route, and enabled on
example.com/path still routes to Workers.
I’m aware that the
* wildcard operator matches zero or more of any character, but was hoping disabling Workers on
example.com/path would take precedence over
example.com/path*. It’s arguable, but I feel that’s in the spirit of the Routes doc:
When more than one route pattern could match a request URL, the most specific route pattern wins.
?* could be supported to denote a query string.
Given the same path, is there someway to route to a Workers script only when a query string exists?