Sling Dynamic Include + Dispatcher + Component Caching !! | Community
Skip to main content
Level 2
December 8, 2016
Solved

Sling Dynamic Include + Dispatcher + Component Caching !!

  • December 8, 2016
  • 2 replies
  • 1555 views

Hello,

I have recently implemented SDI based header and footer in my project. And everything looks good. But I wonder is there any way I can avoid hitting AEM publish/author to construct the HTML markup for header/footer. As per the documentation and per the great minds thoughts in this thread, I understand that there won't be much impact on the performance, But I still feel if there is way to avoid hitting AEM. Please note, I am referring to the synthetic resources.

I have followed this route - <sly data-sly-resource="/content/appname/en/jcr:content/heaedernavbar.html"></sly>

And I can see the following tag in cached file in webserver doc root - <!--#include virtual="/content/appname/en/jcr:content/heaedernavbar.cache.html" --> 

I can see heaedernavbar.cache.html getting created at docroot/html/content/appname/en/jcr:content location. 

Hope this way, I can have the cached file at a central location and using the ACS commons dispatcher flush rules in the OSGI configs I can flush the cache when needed without having to worry about entire content of the site. Please suggest if there is any other better solution. 

Thanks,

Suresh R

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Given the information you provided it looks good to me. You offloaded the rendering of the header and include it to the page on the dispatcher using SSI.

Jörg

2 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
December 8, 2016

Given the information you provided it looks good to me. You offloaded the rendering of the header and include it to the page on the dispatcher using SSI.

Jörg

Level 2
December 15, 2016

Thanks Joerg for your time.

Yes its working fine with no issues so far.