Assistance Needed: Cache Invalidation for Multiple Domains in AEM as a Cloud Service | Community
Skip to main content
New Member
July 28, 2025
Solved

Assistance Needed: Cache Invalidation for Multiple Domains in AEM as a Cloud Service

  • July 28, 2025
  • 3 replies
  • 476 views

Hello Community,


We are utilizing AEM as a Cloud Service and managing multiple domains for each program.


For example, we have several domains such as "www.mysite1.com" with the content path /content/mysite1 and "www.mysite2.com" with the content path /content/mysite2.


We have configured vhost and farm files for each domain, creating the following document roots:


www.mysite1.com → /var/www/html/www.mysite1.com
www.mysite2.com → /var/www/html/www.mysite2.com

We did not include a serveralias in the above farm files

Cache is stored as follows:


For "www.mysite1.com": /var/www/html/www.mysite1.com/content/mysite1/..
For "www.mysite2.com": /var/www/html/www.mysite2.com/content/mysite2..

To handle cache invalidation for multiple domains, we created a new farm file for this purpose according to Adobe's documentation:

"

/farm_invalidate {

/virtualhosts { "*localhost*" }
/renders {
/rend01 { /hostname "127.0.0.1" /port "4503" }
}
/cache {
/docroot "/var/www/html" # Higher-level docroot encompassing both site1 and site2
/statfileslevel "1"
/invalidate {
/0000 { /glob "*" /type "allow" }
}
}
}
"

When we publish any page, the above farm files for invalidation are being recognized, but the cache clearing is not functioning as expected.

From my understanding, to resolve this, should I set the docroot to /var/www/html for all farm files and adjust the cache paths to /var/www/html/content/mysite1 and /var/www/html/content/mysite2? Or is there a better approach to maintain document roots with domains while ensuring proper cache invalidation in AEM Cloud?


your help is highly appreciated.

 

 

Best answer by SantoshSai

Hi @sathyaprathipati,

Based on my understanding and experience, you could try one of the following approaches to resolve the cache invalidation issue:


Update all your farm files (mysite1, mysite2, and the invalidate farm) to use a common docroot, like:

/docroot "/var/www/html"

This way, the cache paths are consistent across all farms, and the invalidation farm will correctly reference the same cache structure. You’ll just need to adjust the filters and rules in each farm to handle only their respective domain paths.

 

OR

If you want to keep using separate docroots (like /var/www/html/www.mysite1.com), then you’ll need to create a separate invalidate farm for each domain, each pointing to its respective docroot. That ensures the statfiles and cache paths match up during invalidation.


In both cases, the key is that the invalidation path must match the actual cache structure relative to the farm’s docroot - otherwise, the .stat files won’t align and the cache won't be cleared.

 

3 replies

TarunKumar
Community Advisor
Community Advisor
July 28, 2025

HI @sathyaprathipati ,

To support URLs that include domain names and their corresponding virtual hosts, define the following Dispatcher farms:

  • Configure a Dispatcher farm for each virtual host. These farms process requests from the web server for each domain, check for cached files, and request pages from the renders.
  • Configure a Dispatcher farm that is used for invalidating content in the cache, regardless of which domain the content belongs to. This farm handles file invalidation requests from Flush Dispatcher replication agents.

 

You can find more details on below link

https://experienceleague.adobe.com/en/docs/experience-manager-dispatcher/using/configuring/dispatcher-domains#create-a-dispatcher-farm-for-cache-invalidation

Hope it helps!


-Tarun

New Member
July 28, 2025

HI @tarunkumar ,

 

Thanks for your reply.

 

As mentioned in the post, we have separate farm file for each and every domain, and separate farm file for invalidation. it didnt help with the domain docroot.

 
SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
July 28, 2025

Hi @sathyaprathipati,

Based on my understanding and experience, you could try one of the following approaches to resolve the cache invalidation issue:


Update all your farm files (mysite1, mysite2, and the invalidate farm) to use a common docroot, like:

/docroot "/var/www/html"

This way, the cache paths are consistent across all farms, and the invalidation farm will correctly reference the same cache structure. You’ll just need to adjust the filters and rules in each farm to handle only their respective domain paths.

 

OR

If you want to keep using separate docroots (like /var/www/html/www.mysite1.com), then you’ll need to create a separate invalidate farm for each domain, each pointing to its respective docroot. That ensures the statfiles and cache paths match up during invalidation.


In both cases, the key is that the invalidation path must match the actual cache structure relative to the farm’s docroot - otherwise, the .stat files won’t align and the cache won't be cleared.

 

Santosh Sai
kautuk_sahni
Community Manager
Community Manager
September 1, 2025

@sathyaprathipati just checking in! Were you able to get this resolved? If one of the replies above helped—whether it completely solved the issue or simply pointed you in the right direction—marking it as accepted can make it much easier for others with the same question to find a solution. And if you found a different way to fix it, sharing your approach would be a great contribution to the community. Your follow-up not only helps close the loop but also ensures others benefit from your experience. Thanks so much for being part of the conversation!

Kautuk Sahni