Tuesday, 23 September 2025

How to Configure Dispatcher Flush Agent in AEM: A Practical Guide

🌟 Quote of the Day

"Sometimes you win, sometimes you learn."

Dispatcher Flush Agent

It is replication agent used to clear/invalidate cache from the Dispatcher whenever content is activated or deactivated.

Multiple Ways to Clear Cache on Dispatcher

  1. Using AEM Dispatcher Flush Agent – Automatically clears cache when content is activated or deactivated.

  2. Using ACS Commons – Provides additional tools and utilities to invalidate or flush dispatcher cache selectively.

  3. Manual or Custom Code – Manually deleting cached files on the dispatcher or writing scripts to programmatically clear cache.

 
How to Configure Dispatcher Flush Agent

1. Dispatcher Flush Agent on Author

  • Not recommended in most cases.

  • Author instance is primarily for content creation, not for serving live traffic.

  • If configured, it can trigger cache invalidation on the dispatcher, but it may cause unnecessary load.

2. Dispatcher Flush Agent on Publish

  • Recommended approach.

  • Publish instance serves live content through the dispatcher.

  • Flush agent is triggered automatically whenever content is activated (published) or deactivated, clearing the relevant cache.

Steps to configure:



  1. Traverse to author instance. http://localhost:4502/sites.html/content

 2. Click on Adobe Experience Manager icon → tools → Deployment → Replication as shown below:

3. Click on Agents on Author as highlighted below:


4. Select Dispatcher flush option as shown below:

5. Click on Edit option as highlighted below:


6. Set dispatcher URL and PORT as shown below:



7. Check the Enabled checkbox to enable disable flush agent. Click on OK to save the changes.


8. It will show below highlighted green color radio button on successful enable.


9. Click on Test Connection anchor link to verify connection in between dispatcher and author instance.


10. To resolve above issue, lets open dispatcher.any file and update below line to allow 127.0.0.1 address:

Inside allowedClients we can allow specific IP addresses or IP ranges which are permitted to access the Dispatcher or AEM instance.



11. Below is the screen shot of the page and its cached timestamp.


12. Publish the home page as shown below:

13. home page will get deleted from the cache directory, as shown below, as soon as we publish the page.


Dispatcher Flush Agent on Publish


Steps to configure:

1. Click on Adobe Experience Manager icon → tools → Deployment → Replication as shown below:

3. Click on Agents on publish as highlighted below:


4. Select Dispatcher flush option as shown below:



5. Click on Edit option as highlighted below:


6. Set dispatcher URL and PORT as shown below:




7. Check the Enabled checkbox to enable disable flush agent. Click on OK to save the changes.




The Author and Publish instances share the same base AEM setup, but their configurations differ based on their role: 
Author = content creation, Publish = content delivery.



🔹 Step-by-Step Flow After Publish/Activate

1. Author Instance (Content Created/Updated)

  • Author creates or edits a page, asset, or component.

  • When finished, the content is published (activated).


2. Replication Agent on Author

  • The replication agent sends the content from Author → Publish.

  • This includes the page/asset data, references, and metadata.


3. Publish Instance (Receives Content)

  • The content is stored in the Publish instance JCR.

  • Now, the publish instance has the latest version of that page/asset.


4. Dispatcher Flush Agent (on Publish)

  • A dispatcher flush agent is triggered automatically.

  • It tells the Dispatcher (cache layer) to clear or invalidate the old cache for that content.


5. Dispatcher (Cache Layer)

  • Dispatcher removes the outdated cached file(s).

  • The next time a visitor requests that page, Dispatcher fetches the fresh content from Publish and caches it again.


6. End User (Website Visitor)

  • Visitor requests the page (e.g., homepage).

  • Dispatcher serves the latest version that was just published.

  • ✅ Website shows updated content instantly.


home page will get deleted from the cache directory, as shown below, as soon as we publish the page.



Thank you !!


No comments:

Post a Comment

Extending AEM Components Using sling:resourceSuperType — Powered by Sling Resource Merger

Quote's of the day "You never fail until you stop trying" What is Sling Resource Merger ?   Sling Resource Merger is the hidd...