Adding ResourceType along with nocache.html in Sling dynamic include | Community
Skip to main content
Level 2
August 23, 2022
Solved

Adding ResourceType along with nocache.html in Sling dynamic include

  • August 23, 2022
  • 3 replies
  • 1484 views

 

I configured   SDI of javascript type using  https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/set-up-sling-dynamic-include.html?lang=en

 

 

When I access the page, the code of that component is written as:

 

<script type="text/javascript">
jQuery.get("\/content\/global/en/about-us/news/_jcr_content/root/responsivegrid/news.nocache.html/sample/components/content/news.htmll",
function(data) {
jQuery("#dynamic_include_filter_div_1000").replaceWith(data);
});
</script>

 

.nocache.html/resource type/pagename

resource type is sample/components/content

 

I don't know why the resource type is appended with .nocache.Html.

 

Has anyone faced this issue previously?

 

 

 

 

 

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 Shiv_Prakash_Patel

Hi @dillibabu77 ,

You are seeing the resource type is appended with .nocache.html because you have configured Filter Selector = nocache.

Along with the SDI configuration, we also need to do the following configuration on the dispatcher's side.

  1. Enable Include module in httpd.conf (LoadModule include_module modules/mod_include.so).
  2. SetOutputFilter as INCLUDES in httpd.conf
        <IfModule dispatcher_module>
            SetHandler dispatcher-handler
        </IfModule>
        SetOutputFilter INCLUDES
  3.  Add Includes option to Options directive
        <Directory />
            Options FollowSymLinks Includes
            AllowOverride None
        </Directory>
  4. Disable the caching for .nocache.html files in dispatcher.any at the end of the /rules section.
        /disable-nocache
        {
            /glob "*.nocache.html*"
            /type "deny"
        }

Sling Dynamic Include Github Reference - https://github.com/wttech/Sling-Dynamic-Include 

Hope this could help you !!!

Thanks

Shiv

 

3 replies

Sachin_Arora_
Community Advisor
Community Advisor
August 24, 2022

SDI appends nocahe.html which is identified at dispatcher level to avoid caching the HTML. Below is the rule added at dispatcher level.

{
    /glob "*.nocache.html*"
    /type "deny"
}   
Shiv_Prakash_Patel
Community Advisor
Shiv_Prakash_PatelCommunity AdvisorAccepted solution
Community Advisor
August 24, 2022

Hi @dillibabu77 ,

You are seeing the resource type is appended with .nocache.html because you have configured Filter Selector = nocache.

Along with the SDI configuration, we also need to do the following configuration on the dispatcher's side.

  1. Enable Include module in httpd.conf (LoadModule include_module modules/mod_include.so).
  2. SetOutputFilter as INCLUDES in httpd.conf
        <IfModule dispatcher_module>
            SetHandler dispatcher-handler
        </IfModule>
        SetOutputFilter INCLUDES
  3.  Add Includes option to Options directive
        <Directory />
            Options FollowSymLinks Includes
            AllowOverride None
        </Directory>
  4. Disable the caching for .nocache.html files in dispatcher.any at the end of the /rules section.
        /disable-nocache
        {
            /glob "*.nocache.html*"
            /type "deny"
        }

Sling Dynamic Include Github Reference - https://github.com/wttech/Sling-Dynamic-Include 

Hope this could help you !!!

Thanks

Shiv

 

Shiv Prakash
Level 2
August 24, 2022

I have done this configuration already.Before SP13, url was   .nocache.html  .

After s913, url changed to /resource type/.

ArpitVarshney
Community Advisor
Community Advisor
January 13, 2023

Hi @dillibabu77 

We also noticed the same issue with SDI while upgrading to SP15. This happened only for Experience Fragment because it seems to be treating XF as a synthetic resource after the upgrade.

Were you able to fix this issue? Is there any way to letting SDI know to not append resource type in the URL?

 

Regards,

Arpit Varshney

Pallavi_Shukla_
Community Advisor
Community Advisor
August 24, 2022

hi @dillibabu77 

experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/set-up-sling-dynamic-include.html?lang=en

 

Please go through the video available on the above page for detailed setup /configuration for SDI setup/management/