I try to create a microcaching in Nginx by configuring that only valid for the subpath of some URI that will work. For example :
https://example.com/path/anotherpath/view/ --> Will be cached https://example.com/path/anotherpath/view/subview --> not to be cached
I have tried this but it does not come out with luck
if ($uri ~* "/path/anotherpath/[^]+/[^]+") {set $no_cache "1";}
And this:
location ~* "/path/anotherpath/[^]+/[\d]" {set $no_cache "1";}
If you guys have any suggestions, they will be much appreciated.