Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Server side include and Sling dynamic include?

Tags:

jsp

ssi

aem

sdi

Can anyone tell me the difference between Server side include and sling dynamic include and their respective use cases ?

like image 812
Gaurav Avatar asked Aug 08 '13 19:08

Gaurav


People also ask

What is sling dynamic include?

The purpose of the sling dynamic includes (SDI) is to replace dynamically generated components (eg. current time or foreign exchange rates) with server-side include tag (eg. SSI or ESI). Therefore the dispatcher is able to cache the whole page but dynamic components are generated and included with every request.

What is dynamic include?

The liferay-util:dynamic-include tag is an extension point for inserting content (e.g., JavaScript code, HTML, and more). To do this, create a module that has content you want to insert, register that content with the dynamic include tag, and deploy your module.


1 Answers

Sling Dynamic Include is actually a way of using Server Side Includes in Apache Sling (or CQ5). Whenever SDI finds an include, it will replace it with a SSI tag, so the include will be done by the http server and not by the sling engine.

There are some nice slides about that explains how it works. They provide a very nice use case for SDI, when you need to cache almost all a page but you still need to render a particular resource using sling, an 'account menu' in a otherwise static page, for example. There's also a blog post available with some more commentary than you can find in the slides.

One nice thing about them is that it is configured through the OSGi console, so you can turn if off (developers might not have Apache installed) or specify which resourceTypes includes to be turned into SSI

like image 61
santiagozky Avatar answered Sep 20 '22 23:09

santiagozky