Difference between Embed and Dependencies
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?
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?
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
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.