Page rule to Cache rule with wildcard

Hi,

Our current website setup is that we cache all pages by default and then use the page rules to bypass cache.
With the migration to Cache Rules we need to replicate something similar.

When reading further into Cache Rules, it appears that the support for wildcards has been dropped.
As an example, if we want to currently bypass cache using page rules for any url that matches the pattern /fee/*/fii/*/ then we can, however, in Cache Rules we are not able to utilize the asterisk on a URI, nor are we able to to use regex matching.

We can create a Cache Rule that’ll do something similar, i.e "begins with /fee/ and “container /fii” but it starts to get a bit complicated when this may match other routes.

Is it possible to use wildcards within Cache Rules? Am I doing something wrong?

Thanks

Wildcard support for Cache Rules and for Ruleset Engine in general is coming this year.

If you can’t use matches operator and if a combination of functions like starts_with, ends_with, substring and concat doesn’t lead to desired results, I would suggest to wait until we release wildcard support. :wink:

1 Like

I do not see the ‘wildcard’ option under the expression builder under cache rules. Our current version of the rules use wildcards in page rules, and they have been tested and in production for several years. I do not want to risk errors by having to re-write them as regex or change the logic by using multiple steps.

You should see the wildcard operator now: Go wild: Wildcard support in Rules and a new open-source wildcard crate.

1 Like