Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Dispatcher cache rule priority

Avatar

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

Avatar

Correct answer by
Level 10

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

Avatar

Correct answer by
Level 10

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.

Avatar

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

Avatar

Level 10

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