Wednesday, June 22, 2016

Dispatcher Cache Invalidation for Multi Site Configuration - Adobe CQ5(AEM)

This post will explain the approach to invalidate the cache for particular site in multi site configuration - Adobe CQ5(AEM).

Recently, i was working on a dispatcher caching issue with multi site configuration - The cache was not getting invalidated in all the dispatcher.

The setup is with multiple dispatcher connected via load balancer. The load balancer will route the request to individual dispatchers via round robin algorithm. The dispatcher is configured with individual virtual host and farm for every site(Load balanced DNS is used).

The flush agent was configured in publisher for every site with load balanced DNS(the flush agent was equal to number of sites configured in dispatcher) - The issue here is when ever publisher send the invalidation request that is not reaching the corresponding dispatcher as the flush agent is configured with load balanced DNS for invalidation URI - The request will be send to random dispatcher from the load balancer due to this the cache will not be invalidated in all the dispatcher.


Create a flush agent in individual publisher that points to individual dispatcher(based on the renders configuration). The flush agent should be configured with dispatchers server name(one flush agent in one publisher)

Make sure the following HTTP Headers are configured.

The flush agent can be configured in author also, if we are configuring in author then the number of flush agents should be equal to number of dispatchers.

Create a Location Match in all the dispatchers httpd.con file for all the websites.

<LocationMatch "^/dispatcher/invalidate.cache$">
    # Site Finance
    SetEnvIfNoCase CQ-Path ".*/content/sample1/.*"
    RequestHeader set Host %{FLUSH_HOST}e env=FLUSH_HOST

    # Site TR
    SetEnvIfNoCase CQ-Path ".*/content/sample2/.*"
    RequestHeader set Host %{FLUSH_HOST}e env=FLUSH_HOST

Based on the CQ-Path the corresponding sites cache will be invalidated.

Referred from  -


  1. Hi Albin,

    In addition to the above steps, please increase the stat file level to maximum depth of pages/assets-1, for each of the farms corresponding to each of the domain.


  2. This comment has been removed by the author.


Contact Form


Email *

Message *