Expand my Community achievements bar.

SOLVED

Personalized Content takes too much time to load

Avatar

Level 1

Hi,

I have noticed that any personalized content takes time to load (AEM 6.1). I believe this is because there is a front-end JS logic where segments are resolved first and then the campaign is loaded based on resolved segment and this process takes time.

But there is huge delay even before the ClientContextMgr registers (CQ_Analytics.JSONPStore.registerNewInstance) any store and takes same time from there if we have more than one store related to the segments which are tied to the campaign.

This part of code from "/libs/cq/personalization/clientlib/kernel/source/shared/clientcontextmanager.js" where it initializes the timer between stores. This is what seems to be causing the initial delay.

/** * Number of milliseconds between the last store gets registered and the event storesinitialize * gets fired. * @final * @private */ CQ_Analytics.ClientContextMgr.prototype.INITIALIZATION_EVENT_TIMER = 1000;

My questions are,

  1. Why is this 1 sec delay mandatory between each store?
  2. We are planning to overlay this code to reduce the timer. Do you see any complications doing it? (Considering we may only end up using 1 or 2 stores)

 

Thanks in Advance.

Phani J

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi,

The root cause of the issue may not be because of resolving segments. Actually, once segment gets resolved, Teaser component makes an ajax call to load the resolved content and that's the reason it is quite slow especially when there is heavy personalized content.

To answer your question regarding timer change, below line explains the whole story.

* Number of milliseconds between the last store gets registered and the event storesinitialize

FYI: AEM ClientContext loads the store and there are javascipt events which gets binded with analytics framework. So, Frameworks make sure that store is ready for use before binding events.

Hope this helps.

---

Jitendra

View solution in original post

5 Replies

Avatar

Level 10

Hi, yes it would have some delay while executing. I assume you would have more time delay in your author instance however it should be less delay in publish instance while you are accessing via webservers with cache in place.

Avatar

Level 1

We do have CDN in place and all of the JS/CSS files are served from CDN cache. Even after all of that, we still see the delay. Also remember "INITIALIZATION_EVENT_TIMER" (1000ms) is same irrespective of whether its author or publish. 

Avatar

Correct answer by
Level 9

Hi,

The root cause of the issue may not be because of resolving segments. Actually, once segment gets resolved, Teaser component makes an ajax call to load the resolved content and that's the reason it is quite slow especially when there is heavy personalized content.

To answer your question regarding timer change, below line explains the whole story.

* Number of milliseconds between the last store gets registered and the event storesinitialize

FYI: AEM ClientContext loads the store and there are javascipt events which gets binded with analytics framework. So, Frameworks make sure that store is ready for use before binding events.

Hope this helps.

---

Jitendra

Avatar

Level 10

I recommend watching Dan Klco's YouTube video on this subject - he covers best practices when using Personalization. This is great community content on this subject. 

https://www.youtube.com/watch?v=LEXzNmtf3_s

I hope this helps you.... 

Avatar

Level 1

Hi All,

Did anyone found solution of this problem ? as we are also having same problem and it takes time to load the targeted component