AEM cloud Dispatcher Invalidate Multiple Domains issue | Community
Skip to main content
Level 2
August 4, 2023
Solved

AEM cloud Dispatcher Invalidate Multiple Domains issue

  • August 4, 2023
  • 2 replies
  • 3668 views

Hi ,

I am trying to setup multiple domains on the AEM cloud and i have done all the vhosts and farm configuration. I am able to render both sites with different docroot . However i am having trouble invalidating dispatcher cache when replicating the page from author to publish and the dispatcher cache invalidation. when i try to publish the the XML,  the cache invalidation needs to be done for "wwwfarm" however i am always seeing localhost being selected and its going to the last farm "stagefarm' and invalidating in the wrong path. I did not find anything related this adobe documentation. If we have multiple sites with different docroot on the same AEM cloud instances how do we invalidate the dispatcher cache on the right cache directory. Any inputs are appreciated?

 

 

 

farms[wwwfarm].cache.docroot = /mnt/var/www/html/www ----> www.site1.com farms[stagefarm].cache.docroot = /mnt/var/www/html/stage ---> www.site2.com

 

No farm matches host 'localhost', selected last farm 'stagefarm', referer: about:blank Found farm stagefarm for localhost, referer: about:blank checking [/dispatcher/invalidate.cache], referer: about:blank Activation detected: action=Activate [/content/dam/www/xml-sitemaps/es-sitemap.xml], referer: about:blank Touched /mnt/var/www/html/stage/.stat, referer: about:blank Touched /mnt/var/www/html/stage/content/.stat, referer: about:blank Touched /mnt/var/www/html/stage/content/dam/.stat, referer: about:blank response.status = 200, referer: about:blank response.headers[Server] = "Communique/2.6.3 (build 5221)", referer: about:blank cache flushed,

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DPrakashRaj

Is that how its done for the cloud ? per adobe documentation it said we need to setup a docroot for each site and dispacther from the documentation below

 

https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-domains.html?lang=en


if you are doing that way then you need to have a separate Configuration of Dispatcher farm for invalidating the content.

see Configure Dispatcher to Handle Multiple Domains section on https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-domains.html?lang=en#create-a-dispatcher-farm-for-cache-invalidation

"Configure a Dispatcher farm that is used for invalidating content the cache, regardless of which domain the content belongs to. This farm handles file invalidation requests from Flush Dispatcher replication agents."

 

2 replies

DPrakashRaj
Community Advisor
Community Advisor
August 5, 2023
NOTE

For proper Dispatcher invalidation, make sure that requests from “127.0.0.1”, “localhost”, “.local”, “.adobeaemcloud.com”, and “.adobeaemcloud.net” are all matched and handled by a vhost configuration so the request can be served. You can do this task by global matching “*” in a catch-all vhost configuration following the pattern in the reference AEM archetype. Or, you can ensure that the previously mentioned list is caught by one of the vhosts.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching.html

 

Level 2
August 6, 2023

i did have those defined, but when the page is published the cache invalidation does not seem to going to the right folder. Does both Vhosts needs to have the localhost defined? How does the cache 

 

<VirtualHost *:80> ServerName site1.com # Put names of which domains are used for your published site/content here # ServerAlias "*" ServerAlias "localhost" ServerAlias "*.local" ServerAlias "www.site1.com" ServerAlias "*.adobeaemcloud.com" ServerAlias "*.adobeaemcloud.net" ServerAlias "publish*.adobeaemcloud.net" ServerAlias "publish*.adobeaemcloud.com" ServerAlias "preview*.adobeaemcloud.com" DocumentRoot "${DOCROOT}/www" <VirtualHost *:80> ServerName site2.com # Put names of which domains are used for your published site/content here # ServerAlias "*" ServerAlias "localhost" ServerAlias "*.local" ServerAlias "www.site2.com" ServerAlias "*.adobeaemcloud.com" ServerAlias "*.adobeaemcloud.net" ServerAlias "publish*.adobeaemcloud.net" ServerAlias "publish*.adobeaemcloud.com" ServerAlias "preview*.adobeaemcloud.com" DocumentRoot "${DOCROOT}/stage"

 

DPrakashRaj
Community Advisor
Community Advisor
August 6, 2023

Yes, both vhost should have those configuration. Is it still selecting the wrong farm for you?

Jagadeesh_Prakash
Community Advisor
Community Advisor
August 7, 2023

@ranjithreddygu  I also faced this issue. The issue is because the default host is picked up by default on priority list. So to change the order of the loading vhost or farm files add 111_******** to the enable_vhosts files or enable_farm files. refer to below screenshot. If you are still unable to understand the issue DM . I can explain it 

 

Level 2
August 7, 2023

hi @jagadeesh_prakash  I have already done this and my enable_vhosts files or enable_farm files are loading in the correct order and i have then numbered like 001_wwfarm and 002_stagefarm . The invalidation seem to be going to right path when coming the domain name is attached and TTL expires , only issue is invalidation when publishing pages from author to publish on cloud.

Jagadeesh_Prakash
Community Advisor
Community Advisor
August 8, 2023

@ranjithreddygu  what is the cache rules that you have set. Can you check if yoru headers are accepted ? 

make sure s-maxage is not 0