Highlighted

AEM 6.2 - Pages creation with cacheable and non cacheable components.

Avatar

Avatar

kalyanc42390873

Avatar

kalyanc42390873

kalyanc42390873

28-06-2016

Hi,

We are implementing a project using AEM 6.2 version. We are having both static & dynamic components on the page.

We are looking for option to build our components such way that entire page will be cached except the dynamic component sections(these dynamic components should render the content dynamically)

Can you anyone please let me know what will be the best solution to achieve this. 

 

Thanks in advance. 

Regards,

Kalyan

Replies

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

28-06-2016

To cache AEM pages - you use Dispathcer. See: 

https://docs.adobe.com/docs/en/dispatcher.html

In AEM 6.2 - its recommended that you build your components using Sightly. 

https://docs.adobe.com/docs/en/aem/6-2/develop/sightly.html

So what controls caching is how you configure Dispatcher - not how you build components. 

Highlighted

Avatar

Avatar

leeasling

Avatar

leeasling

leeasling

28-06-2016

This [1] does exactly what you need and works great.  Also see [2].

You can do it a number of ways, including by specifying a configuration in AEM for the resourceTypes to target.  It's pretty neat.

[1] https://github.com/Cognifide/Sling-Dynamic-Include

[2] https://www.cognifide.com/our-blogs/cq/sling-dynamic-include/

Highlighted

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.5K

Likes

959

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.5K

Likes

959

Correct Answer

1.1K
kautuk_sahni
Community Manager

28-06-2016

Hi

In order to accomplish a combination of static & dynamic content, You must use Sling Dynamic module. Here is the doc.

https://www.cognifide.com/our-blogs/cq/sling-dynamic-include/ (Excellent Read)

Using the sling dynamic module, You can make sections of the page non-cachable in your case it is body of the page.

Thanks and Regards

Kautuk Sahni

Highlighted

Avatar

Avatar

kalyanc42390873

Avatar

kalyanc42390873

kalyanc42390873

29-06-2016

Thanks for quick response. We will follow the links shared by you guys. if we stuck anywhere will get back to you

Highlighted

Avatar

Avatar

kalyanc42390873

Avatar

kalyanc42390873

kalyanc42390873

29-06-2016

Hi,

Can you give the sample how to Sling dynamic include tags for the dynamic components like header,footer,registration etc..,.?

Thanks & Regards,

C.Kalyan

Highlighted

Avatar

Avatar

PuzanovsP

MVP

Avatar

PuzanovsP

MVP

PuzanovsP
MVP

29-06-2016

Hey Kalyan,

Have a look at the adaptTo presentation, think it answers your question:

http://www.pro-vision.de/content/dam/pro-vision/production/adaptto/2012/adaptto2012-sling-dynamic-in...

Regards,

Peter

Highlighted

Avatar

Avatar

kalyanc42390873

Avatar

kalyanc42390873

kalyanc42390873

29-06-2016

Hi,

Could anyone help me is there any sample code, how to include the dynamic components in place holder

Thanks & Regards,

C.Kalyan