Hi AEM guru,
To improve our AEM page performance, we are trying to implement async/defer for our client lib js and css but it is not working.
This is our inclusion tag
Solved! Go to Solution.
Hi @aem_dev2 ,
This should work.
Hi @aem_dev2!
Have you tried the approach outlined in the following documentation?
<sly data-sly-use.clientlibs="${'com.adobe.cq.wcm.core.components.models.ClientLibraries' @
categories='wknd.base',
media='print',
async=true,
defer=true,
onload='console.log(\'loaded: \' + this.src)',
crossorigin='anonymous'}">
${clientlibs.jsAndCssIncludes @ context="unsafe"}
</sly>
Please note: Your third code snippet does seem to be missing a comma "," between the categories and the async attributes.
Hope that helps!
Hi @aem_dev2 ,
This should work.
This does not work - the correct answer is https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-add-async-defer-att...
Views
Replies
Total Likes
hi,
OOTB it does not supported.
you can follow the approach suggested by @markus_bulla_adobe or you can create your own Clientlibs model
e.g. https://github.com/arunpatidar02/aem63app-repo/blob/master/java/ClientLibsModel.java
Views
Likes
Replies
Views
Like
Replies