gee1
June 4, 2019, 10:43am
1
Hi all. Looking for some RegEx gurus to help me create a page rule.
I have a page rule https://example.com/ * where I have Browser Cache TTL, Edge Cache TTL and Cache Level turned up to the max. I want to exclude a URL from it, but have child URLs maintain the ‘cache everything’ status.
So https://example.com/hello/ is excluded from the above cache settings, but https://example.com/hello/123456/ (as well as every other page URL sitting under /hello/) is cached by the page rule.
I tried using RegEx ‘negative look ahead’ and came up with:
https://example.com ((?!/hello/$)*$
but that doesn’t seem to work. Any help greatly appreciated!
sandro
June 4, 2019, 10:45am
2
Page rules do not use regular expressions, but simply wildcards. In your case you might need to rules
/hello
-> dummy rule to skip the second one, just choose a random setting not interfering with others
/*
-> your actual rule to cache everything else
gee1
June 4, 2019, 10:52am
3
Wow, that was quick! Thanks for getting back to me so quickly.
So if I added a rule for /hello/
with whatever setting, /hello/there/
(for example) wouldn’t be affected?
sandro
June 4, 2019, 10:54am
4
As long as you do not put an asterisk at the end.
1 Like
system
Closed
July 5, 2019, 4:43pm
6
This topic was automatically closed after 31 days. New replies are no longer allowed.