Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Adding ResourceType along with nocache.html in Sling dynamic include

Avatar

Level 3

 

I configured   SDI of javascript type using  https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/set-up-sling...

 

Dillibabu77_0-1661276278105.png

 

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?

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

5 Replies

Avatar

Community Advisor

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"
}   

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 3

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

After s913, url changed to /resource type/.

Avatar

Community Advisor

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

Avatar

Community Advisor

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/