March 16, 2020
Estimated Post Reading Time ~

CQ Dispatcher Flush Setup

CQ Flush Agent is required to invalidate / clean dispatcher cache. Before you set dispatcher Flush to make sure that the replication agent is set up properly. It is recommended to configure the dispatcher flush agent on publish instance.

Configure Dispatcher Flush On Publish:
§ Go to HOST:PORT/libs/cq/core/content/login.html
§ Login as admin/admin
§ Then click on Tools -> Replications -> Agents on Publish (You can also go to HOST:PORT/miscadmin#/etc/replication/agents.publish)


You can then click on new -> Page -> Give Dispatcher Agent Information
§


Once the page is created, Double click on dispatcher flush agent and then click on edit
§ On the first Tab (Dispatcher Settings) tab. Have the following setting. Serialization Type tells CQ that this is a dispatcher flush agent and not a normal replication agent.


Then on the transport tab and enter the dispatcher server URL. URL is HOST: PORT/invalidate_only/dispatcher/invalidate.cache when this request reaches dispatcher, Dispatcher module knows that it is flush request and then it invalidates the cache.


From Trigger Tab set the following triggers. This is required if you are setting dispatcher flush agent on publish instance (But not if you are setting it on the author). Through this trigger, the replication agent knows when to trigger a flush.


Once all settings are done you can select dispatcher flush agent and click on replicate (Make sure that replication agent is configured before and you see a green light at the end of replication).


You can then create multiple flush agents using the above steps.
§ Note that dispatcher flush only happens on resources of type cq:Page on publish instance. If you have to enable flushing of DAM resource as well then please check this article. http://helpx.adobe.com/cq/kb/HowToFlushAssetsPublish.html
Some Dispatcher Flush Configuration on dispatcher.any file
All dispatcher specific configuration can be obtained from this document http://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_config.html Please go through this carefully.
We will cover some configuration that can effect caching,
§ /cache section
Dispatcher Flush config
/cache { /docroot "/opt/dispatcher/cache" /statfile "/tmp/dispatcher-website.stat" /allowAuthorized "0" /rules { # List of files that are cached example
#Syntax:
#/0001 #{ #/glob "*.html" #/type "allow" #}
# allow *.html this mean cache all file with .html extension
#deny *.txt this mean that do not cache any file with txt extension
#deny */private/* this mean that do not cache any document that has /private/ in URI } /invalidate { # List of files that are auto-invalidated Example
#Syntax
#/0001 #{ #/glob "*.html" #/type "allow" #} #}
#allow *.html mean, for dispatcher flush request all html files will get invalidated. }




By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.