Expand my Community achievements bar.

Need more info on how ignoreurlparams works in dispatcher

Avatar

Level 1

Hi, 

I am a newbie to AEM and was trying to understand ignoreurlparams which is very confusing.

 

Could you help me with which urls would be cached and does order also has significance?

 

/ignoreUrlParams

{

/001 { /glob "*" /type "deny" }

/002 { /glob "param1" /type "allow" }

/003 { /glob "param2" /type "allow" }

}

 

 

URL 1: /mysite/mytest.htmI?param2=a

URL 2: /mysite/mytest.htmI?param1=s&param2=a&param3=h

URL 3: /mysite/mytest.htmI?param10=local

URL 4: /mysite/mytest.htmI?param1=s

URL 5: /mysite/mytest.htmI?param2=a&param1=s

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Community Advisor

Hi @Sahasra_M 

If there are query parameters which are needed by the server side code, then they should explicitly be "denied" from being ignored. For example, consider a search term query param which is used by a server side search method. When a request for en.html?search=cycling is received, it should be handled by the publish tier and always count as a cache miss.

So you should allow caching of all content and deny only specific where you want the request to be a cache miss.

/ignoreUrlParams {
/0001 { /glob "*" /type "allow" }
/0002 { /glob "q" /type "deny" }
/0003 { /glob "anythingelse" /type "deny" }
}


Please refer the link here:
https://github.com/adobe/aem-dispatcher-optimizer-tool/blob/main/docs/Rules.md#dot---the-dispatcher-...

Thanks,

Asutosh

Avatar

Level 1

Thank you for help.

 

So out of the 5 urls, URL1, URL4, URL 5 would be cached. While URL3 would be handled by publish tier since param3 is ignored. But, would URL2 be also cached which is having two parameters as allowed and one being ignored? Let me know if my understanding is correct.

 

Avatar

Community Advisor

Hi @Sahasra_M 

URL 2 will not be cached as it has one parameter which is not in the allowed list.

The approach you are following, is not compliant as any additional parameter in the request such as &abc, &xyz and so on... will prevent caching of the request in dispatcher and will always be a cache miss.

So you should use the allow pattern so all request will be cached with query parameters and deny only specific - for those only you want the request not to be cached.

https://github.com/adobe/aem-dispatcher-optimizer-tool/blob/main/docs/Rules.md#dot---the-dispatcher-...

The above links has the complete details. Let me know if you have any questions.