Sling Dynamic Include + Dispatcher + Component Caching !!
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