Expand my Community achievements bar.

SOLVED

what are the Best Practices for Caching Experience Fragments in AEM: How to Optimize Performance

Avatar

Level 2

What are the most effective caching strategies for Experience Fragments in AEM, and how can I ensure seamless updates to cached pages referencing shared content? I've come across various approaches mentioned in a blog, but I'd like to hear from the community about their experiences and recommendations.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @aem101 

 

The approach that is followed depends on:

- How frequent XF updates are?

- How much cache is affected by these updates?

- What is the caching strategy for the site?

 

You might also notice a difference in behaviour of XF when it is added as part of template (like header) or page (like contributor XF in WKND).

 

- In case of contributor XF, publishing the referenced pages would only affect them (a smaller set). Its the OOTB behaviour now, that all pages referencing the published XF will also be updated.

- In case of header XF, it affects the entire site. In this case, one might even turn off the entire site flush and let ttls update site. This is discussed in blog.

- If there is a use-case, where an XF update is frequent and affects a large set of pages, an SDI approach for such XF will make sense. 


Aanchal Sikka

View solution in original post

6 Replies

Avatar

Community Advisor

I think there was an issue in older versions of AEM where you had to manually figure out a way to flush the XF references, and many times SDI was introduced as a good option, but in AEM 6.5 onwards, if you activate an XF, the page referencing the XF will be flushed from the dispatcher, that is according to this thread: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/experience-fragment-issue-... 

 

Personally, I had to work with options like the ones from this blog: https://sourcedcode.com/blog/aem/caching-experience-fragments-with-aem-sites-6-5 

 

 



Esteban Bustamante

Avatar

Correct answer by
Community Advisor

Hello @aem101 

 

The approach that is followed depends on:

- How frequent XF updates are?

- How much cache is affected by these updates?

- What is the caching strategy for the site?

 

You might also notice a difference in behaviour of XF when it is added as part of template (like header) or page (like contributor XF in WKND).

 

- In case of contributor XF, publishing the referenced pages would only affect them (a smaller set). Its the OOTB behaviour now, that all pages referencing the published XF will also be updated.

- In case of header XF, it affects the entire site. In this case, one might even turn off the entire site flush and let ttls update site. This is discussed in blog.

- If there is a use-case, where an XF update is frequent and affects a large set of pages, an SDI approach for such XF will make sense. 


Aanchal Sikka

Avatar

Level 5

Hi Aanchal

 

Hope you are doing well. 

Is the ootb behavior still intact? We are using 6.5 sp17 with acs commons 6.0.4, core comps 2.23.2 and wknd shared content for validating this. But the cache clear doesn't appear to work for site pages that reference the xfs that are modified and published. Can you please confirm if this feature is still intact? 

 

Thanks 

Mahidhar Ch 

Avatar

Community Advisor

Hello @mahi1729 

 

Please refer to my response on Re: Experience Fragment Caching - Adobe Experience League Community - 639063

 

I hope it helps !

 

I have access only to Cloud SDK, so can't cross-check for 6.5


Aanchal Sikka

Avatar

Level 5

Thanks @aanchal-sikka for your timely response. Yes I saw ur response but somehow with all those nodes present it still doesn't work. I do have cloud sdk on my personal device. I can take a look there. But if you have verified this behavior on cloud sdk please share your inputs if it's working or not.

 

Thanks 

Mahidhar Ch