Expand my Community achievements bar.

SOLVED

Dispatcher Caching : Optimization for Query Parameters

Avatar

Level 3

Hi,

 

I have added the below configuration for ignoreUrl Params in my farm.any file:

/ignoreUrlParams

{

/0001 { /glob "*" /type "allow" }

}

 

And explicitly denied the expected query parameters from being ignored .But whenever I am trying to hit a URL with query parameter it is not getting cached and served from my publisher only. 

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

Is there anything else needs to be done for this to work?

 

 

 

 

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @kanikaa32870678 
Dispatcher module is correctly configured to use the farm.any file. The Dispatcher module's configuration (typically in the httpd.conf file) should include a line like:
DispatcherConfigFile "/path/to/your/farm.any" 
After making changes to the farm.any  file, make sure to restart your web server or reload the configuration to apply the changes. Some changes in the Dispatcher configuration may not take effect until the web server is restarted.
Dispatcher Flush Agent:
If you are testing cache changes, consider using the Dispatcher Flush Agent to invalidate and flush specific URLs or cache paths. This can help ensure that you are observing the effects of your configuration changes.
Thanks.



View solution in original post

4 Replies

Avatar

Level 8

Hi @kanikaa32870678 

suppose if you  have written these under /ignoreUrlParams then all URLs are cached. if the Query Parameter has q or abc then, that URL will not be cached.

/0001 { /glob "*" /type "allow" }

/0002 { /glob "q" /type "deny" }
/0003 { /glob "abc" /type "deny" }

Now are you using multiple parameters? i.e. mean  hello.html?test=123&q=hi

In this case, since the URL has q as one of the query parameter, then the page will not be cached.

Avatar

Community Advisor

@kanikaa32870678 ,

As per your dispatcher ignoreUrlParams configuration, any URL which has at least one URL param from the deny list is not cached and sent to publish server to process the page request.

https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-c...

 

At the same any other URL even with query parameters which not in the deny list are cached.

 

Hope this helps!

 

 

Avatar

Correct answer by
Community Advisor

Hi @kanikaa32870678 
Dispatcher module is correctly configured to use the farm.any file. The Dispatcher module's configuration (typically in the httpd.conf file) should include a line like:
DispatcherConfigFile "/path/to/your/farm.any" 
After making changes to the farm.any  file, make sure to restart your web server or reload the configuration to apply the changes. Some changes in the Dispatcher configuration may not take effect until the web server is restarted.
Dispatcher Flush Agent:
If you are testing cache changes, consider using the Dispatcher Flush Agent to invalidate and flush specific URLs or cache paths. This can help ensure that you are observing the effects of your configuration changes.
Thanks.



Avatar

Community Advisor

Hi @kanikaa32870678 ,

 

You can also enable the dispatcher debug logs to see what is happening on each of the requests and whether its honoring your changes. The config looks good and it should cache the query paramed urls on first hit and should serve from there expect for the explicit denied ones.

Could be an issue with Apache not picking you latest changes

https://blogs.perficient.com/2017/10/12/mastering-aem-dispatcher-part-1-debugging-the-dispatcher/