Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

SDI not working for synthetic resource AEMaaCS

Avatar

Level 2

Hello,

We have one synthetic resource and this resource should not be cached.

I have enabled SDI for this synthetic resource. When rendering this resource in the publisher, it is working fine.

But, when rendering it in the dispatcher, with SDI enabled, It is not rendering.

 

I am using local SDK (Aemaacs) and SDI version 3.3.0.
I have tried with multiple versions of SDI but it is still the same.

 

Additionally, I can't see #include tag from SDI in AEM publish as well as in dispatcher.
But, it is working. I have checked it by adding multiple resource type in the SDI configs.

 

Now, there are two open points

1. How can this synthetic resource be loaded in the dispatcher when SDI is enabled? 

2. How to enable SDI to generate #include tag when rendering SDI-supported components in publisher instance?

 

Please share your suggestion on these topics.

 

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi,

As per sling documentation looks like synthetic components are not compatible . Pls check the below link :- 

https://sling.apache.org/documentation/bundles/dynamic-includes.html#compatibility-with-components

 

The filter is incompatible with the following types of component:

  • components which handle POST requests or GET parameters (query strings),
  • synthetic components which use suffixes (because suffix is used to pass requestType of the synthetic resource).

Thanks,

Somen

 

 

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @RO981 

Just to let you know the SDI path for synthetic resources formed differently than the normal resource.
It appends the resource type in a path like below

<!-- SDI include (path: /content/experience-fragments/sdi-validation/master/_jcr_content/root/text.dynamic.html/weretail/components/content/text, resourceType: weretail/components/content/text) -->

So you need to ensure that the dispatcher configuration should be according to this path and should not restrict this. I think the first step should be checkout dispatcher logs.

Please also checkout these documents if you miss any of the steps


Regards,
Arpit Varshney

 

Avatar

Level 2

Hi @ArpitVarshney 

Yes, I can see these comments in the publisher and dispatcher. 

SDI path is similar to the path you have shared.

I have checked dispatcher logs as well and it look something like mentioned below.
[Fri Mar 10 08:50:29.999814 2023] [dispatcher:debug] [pid 516:tid 281473204501248] checking [/content/experience-fragments/sdi-validation/master/_jcr_content/root/text.dynamic.html/weretail/components/content/text]
[Fri Mar 10 08:50:29.999825 2023] [dispatcher:debug] [pid 516:tid 281473204501248] request URL has no extension: /content/experience-fragments/sdi-validation/master/_jcr_content/root/text.dynamic.html/weretail/components/content/text
[Fri Mar 10 08:50:29.999828 2023] [dispatcher:debug] [pid 516:tid 281473204501248] [client 172.17.0.1:53514] cache-action for [/content/experience-fragments/sdi-validation/master/_jcr_content/root/text.dynamic.html/weretail/components/content/text]: NONE

 

But, it is still not rendering synthetic resource.

Avatar

Community Advisor

@RO981 Is your dispatcher configuration allowing a page with no end extension as the SDI path for a synthetic resource doesn't have an end extension? 

Above shared log clearly indicate dispatcher detected the URL without any extension so check further if it is blocked because of that?

Regards,

Arpit Varshney

Avatar

Level 2

@ArpitVarshney 

Dispatcher has following filter rule.
/0100 { /type "allow" /method "GET" /path "/content/*" }

Other than that, when I hit the resource SDI URL (for e.g./content/experience-fragments/sdi-validation/master/_jcr_content/root/text.dynamic.html/weretail/components/content/text) in the browser, it give me 200OK response.

I believe, dispatcher is not blocking this URL based on these configs and observations.

 

 

Avatar

Level 6

Hi,

Is SDI  working for plain resource ? Is the issue  faced only with synthetic resource or both ?

 

Thanks,

Somen

Avatar

Level 2

Hi @somen-sarkar,
It is working fine for plain resource. Issue exist only for synthetic resource.

Avatar

Correct answer by
Level 6

Hi,

As per sling documentation looks like synthetic components are not compatible . Pls check the below link :- 

https://sling.apache.org/documentation/bundles/dynamic-includes.html#compatibility-with-components

 

The filter is incompatible with the following types of component:

  • components which handle POST requests or GET parameters (query strings),
  • synthetic components which use suffixes (because suffix is used to pass requestType of the synthetic resource).

Thanks,

Somen