This tutorial deep dive into Apache Sling Dynamic Include and explains how to use different include types in AEM to dynamically include the page components in AEM.
SDI(Sling Dynamic Include) Introduction
1. Most of the cases AEM sites contain static data that can be cached in Dispatcher, CDN, or other caching layers.
2. In some cases, small dynamic data makes the entire page not cacheable in Dispatcher or other caching layers, this will increase the overall page loading time and also impact the performance of the publishers as every request reaches to the publisher for rendering.
3. In the above cases, we want to cache almost the whole page in dispatcher and the selected component should be included dynamically.
4. The SDI enables the page to be cached with some placeholder(include) for dynamic data that will be replaced with real content while accessing the page. This enables most parts of the pages to be cached in caching layers and the dynamic data is replaced while accessing the page.
SDI Include Types
Include tags helps to add dynamic data before returning the page to the client, Include tag types available on different layers between the dispatcher and client.