Skip to main content
Level 4
Feb 2, 2016 10:45 AM UTC
Solved

Dispatcher cache rule priority

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Feb 2, 2016 1:22 PM UTC

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.

3 replies

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Feb 2, 2016 1:22 PM UTC

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.

Translate
Sutty100Author
Level 4
Feb 2, 2016 2:24 PM UTC

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 :)

Translate
Lokesh_Shivalingaiah
Level 10
Feb 2, 2016 3:13 PM UTC

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

Translate