When should we use embed and when to use dependencies in Clientlibs. Which one is better? Can someone please answer this in simple terms and some real time scenarios to understand the same?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Shivam153 ,
The main difference is in terms of requests being made to the server.
dependencies
should cause your page to have extra requests to other clientlibs (external "subscribe")
embed
should "aggregate" those other clientlibs INTO the current clientlib (internal subscribe)
There is no better here, as it depends on your use case, it's an architecture choice.
Here you can find great details about them:-
https://khakiout.wordpress.com/2016/02/23/aem-clientlibs-difference-between-dependencies-and-embed/
Hope this helps!
Regards,
Nitesh
Hi @Shivam153 ,
The main difference is in terms of requests being made to the server.
dependencies
should cause your page to have extra requests to other clientlibs (external "subscribe")
embed
should "aggregate" those other clientlibs INTO the current clientlib (internal subscribe)
There is no better here, as it depends on your use case, it's an architecture choice.
Here you can find great details about them:-
https://khakiout.wordpress.com/2016/02/23/aem-clientlibs-difference-between-dependencies-and-embed/
Hope this helps!
Regards,
Nitesh
embed - This defines the categories which will be combined to the current clientlib. AEM will merge all clientlibs into the current clientlib. This is usually used for minimizing requests and for accessing clientlibs which are not supposed to be exposed to public.
Used to embed code from other libraries. If node F embeds nodes G and H, the resulting HTML will be a concetration of content from nodes G and H.
dependencies - This defines the other categories that the current clientlib depends upon. The dependencies will be included in the page along with the dependent clientlib. This property is transitive – if Clientlib A depends on Clientlib B which depends on Clientlib C, then all clientlibs will be included in the page.
Which one to use , it depends on the use case .
Take a look at this document
https://khakiout.wordpress.com/2016/02/23/aem-clientlibs-difference-between-dependencies-and-embed/
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies