Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Dispatcher cache rule priority

Sutty100
Level 5
Level 5

Say I have two rules in my dispatcher config: 

        /0001
        {
            /glob "/ajax/foo/bar.*"
            /type "allow"
        }
        
        /0002
        {
            /glob "*.ajax.*"
            /type "deny"
        }
                /0003
                {
                        /glob "*/ajax/*"
                        /type "deny"
                }

and i have a url like /ajax/foo/bar.x.y.json will it be cached? I thought it would as I assume the rules get applied in the order listed but this does not seem to be the case as my json is not cached.

1 Accepted Solution
Lokesh_Shivalingaiah
Correct answer by
Community Advisor
Community Advisor

Yes, it does in the order

In your order, last rule '/0003' is deny everything with /ajax/ and hence it is not caching. Change the /type "allow" and it should be caching the same.

View solution in original post

3 Replies
Lokesh_Shivalingaiah
Correct answer by
Community Advisor
Community Advisor

Yes, it does in the order

In your order, last rule '/0003' is deny everything with /ajax/ and hence it is not caching. Change the /type "allow" and it should be caching the same.

View solution in original post

Sutty100
Level 5
Level 5

yep flipped my rule to the bottom and it worked, I'd assumed if a rule was more specific and/or a lower number it would take priority but like you say the last rule that matches seem's to be the one it goes with. Thanks 🙂

Lokesh_Shivalingaiah
Community Advisor
Community Advisor

actually all the rules are executed in the order its been creaeted