Need more info on how ignoreurlparams works in dispatcher | Adobe Higher Education
Skip to main content
December 2, 2024
Risolto

Need more info on how ignoreurlparams works in dispatcher

  • December 2, 2024
  • 2 risposte
  • 1563 visualizzazioni

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

 

 

Questo argomento è stato chiuso alle risposte.
Migliore risposta di Asutosh_Jena_

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-publish-farm-cache-should-have-its-ignoreurlparams-rules-configured-in-an-allow-list-manner

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

2 risposte

Asutosh_Jena_
Community Advisor
Community Advisor
December 2, 2024

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-publish-farm-cache-should-have-its-ignoreurlparams-rules-configured-in-an-allow-list-manner

Thanks,

Asutosh

Sahasra_MAutore
December 2, 2024

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.

 

Asutosh_Jena_
Community Advisor
Community Advisor
December 3, 2024

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-publish-farm-cache-should-have-its-ignoreurlparams-rules-configured-in-an-allow-list-manner

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