Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

stores.init.js | every call is hitting publisher - can we cache this call

Avatar

Level 4
Hi all,
 
Was reviewing publisher logs on server.
 
Noticed that below "store.init.js" call is hitting publisher again and again. 

/etc/clientcontext/default/content/jcr:content/stores.init.js?path=index&cq_ck=1456299446600

 
This call is not cached on dispatcher since it has query parameter and also cache busting parameter cq_ck.
 
This call is generated when we have clientcontext enabled on page.
 
Will AEM continue to work normal if I cache this file on dispatcher ?
 
Just trying to save hits on publishers.
 
Thanks in advance.
1 Accepted Solution

Avatar

Correct answer by
Level 10

store.init.js is responsible for getting the segments and resolving the same which could be different for each request and hence it has to hit the publish instance to do the same. However, the experience for the resolved segment would be cached and served from the dispatcher.

View solution in original post

3 Replies

Avatar

Level 10

rohitspathak123 wrote...

Hi all,
 
Was reviewing publisher logs on server.
 
Noticed that below "store.init.js" call is hitting publisher again and again. 

/etc/clientcontext/default/content/jcr:content/stores.init.js?path=index&cq_ck=1456299446600

 
This call is not cached on dispatcher since it has query parameter and also cache busting parameter cq_ck.
 
This call is generated when we have clientcontext enabled on page.
 
Will AEM continue to work normal if I cache this file on dispatcher ?
 
Just trying to save hits on publishers.
 
Thanks in advance.

 

If you using personalization using segmentation or target then you can't cache this otherwise you can change caching rule in dispatcher to enable the caching for this.

Avatar

Correct answer by
Level 10

store.init.js is responsible for getting the segments and resolving the same which could be different for each request and hence it has to hit the publish instance to do the same. However, the experience for the resolved segment would be cached and served from the dispatcher.

Avatar

Level 4

Thanks Amit & Bsloki for your reply.