Expand my Community achievements bar.

SOLVED

AEM Cloud Dispatcher Cache

Avatar

Level 2

We are facing one issue on AEM Cloud, publishing XF is not working on publisher/dispatcher instance - they are still referring old XF and showing old XF content on a page.

Problem:

We are using XF/Experience Fragments included in template for Header and footer. Header and Footer XF are included in the template structure. XF are not getting updated on the pages since the content pages are cached with header and footer html’s as part of the pages. So only updating the XF wont invalidate the pages. The entire content hierarchy would need to be invalidated to see the updated XF content on pages.

 

My questions are

  • How to rectify this issue?
  • Do we need to explicitly invalidate dispatcher/CDN cache? If yes how?
  • Why the cache is hanging on it the old content for so long?

I know about SDI can be implemented here to resolve this but we don't want to include ACS Commons for AEM cloud.

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @Gatsby,

 

First option you have is to publish the pages where the XFs are included and that should invalidate the cache. 

If manually publishing the content tree is not feasible, you can create a custom Event listener to publish the pages where the XF is being included on publish of the XF.

Another option is to open a support ticket with Adobe and request cache flush(not recommended).

 

Also, are you sure its cached on dispatcher or is the cache not validated on Fastly? If it is fastly, you can request Adobe to provide you with a Flush key for the environment and then setup a cURL based job to invalidate fastly cache. 

View solution in original post

7 Replies

Avatar

Level 4

Hi @Gatsby , this seems to a common issue that you are facing. We always have to manually clear the dispatcher cache by going into miscadmin every time when there are changes related to xml or content on a page and there is a new deployment. To clear the dispatcher cache you can follow the steps mentioned in this:
https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/page-invalid...

Still if you are seeing your old page, try passing an empty parameter in your URL and hit enter. For Eg: <your URL>?p=0
By this way, you can make sure the fresh content loads and not the cached content.

To programmatically clear the dispatcher cache please visit:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/flush-dispatcher-cache-pro...

Why the cache is hanging on it the old content for so long?
Cache helps in loading the pages faster so they need to be manually cleared just like in browsers.

Avatar

Community Advisor

@Gatsby  We have similar issue for one of our clients. Where we followed below steps 

 

1. And EventHandler with below properties 

@Component(immediate = true, property = { "event.topics=org/apache/sling/distribution/importer/package/imported",
"event.filter=(|(distribution.type=ADD)(distribution.type=DELETE))" })

 

2. And We prepare list of pages that refer the XF and preparing purgeListObject 

3. And did a cache clear for those particular pages.

 

In a way you can also write a servlet which can do this manually as well. 

Avatar

Level 2

@Jagadeesh_Prakash I like this idea, but this could be performance issue when you clear cache, especially header footer I'll be using on each page, so clearing cache for all those pages leads to performance issue.

Avatar

Correct answer by
Level 4

Hi @Gatsby,

 

First option you have is to publish the pages where the XFs are included and that should invalidate the cache. 

If manually publishing the content tree is not feasible, you can create a custom Event listener to publish the pages where the XF is being included on publish of the XF.

Another option is to open a support ticket with Adobe and request cache flush(not recommended).

 

Also, are you sure its cached on dispatcher or is the cache not validated on Fastly? If it is fastly, you can request Adobe to provide you with a Flush key for the environment and then setup a cURL based job to invalidate fastly cache. 

Avatar

Community Advisor

Hi @Gatsby 

The dispatcher flush listeners are activated when a replication or publish request is initiated. In your scenario, as there is no activation, the dispatcher flush is not triggered. To update the cache, you either need to publish the page after making XF changes or implement custom listeners.

 

please read this 

Efficiently Caching : Experience Fragments on dispatcher

Thanks

Kannan

Avatar

Community Advisor

@Gatsby ,

 

Please take look at this community posted related to flushing pages on activation of the Experience Fragments.

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/experience-fragment-cachin...

Avatar

Administrator

@Gatsby Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni