Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

SDI with Sling Exporter

swapnilg7731718
Level 2
Level 2

hi Team,

 

I need to implement SDI like feature with Sling exporter. My page has many component which is mapped to corresponding model exporter. But need some component to avoid caching  at dispatcher side.

 

Just expecting something like include statement getting generated in dispatcher cache with trigger another request within the cache page json.

 

Any pointer would be appreciated , thanks in advance.

 

Regards,

Swapnil Gupta

SDI Sling exporter
1 Accepted Solution
davidjgonzalezzzz
Correct answer by
Level 5
Level 5

SDI expects the output to be HTML.

Sling Model Exporter implies the output is JSON.

 

What exactly are you trying to do? Are you trying to stitch together a JSON response, where parts are static and other parts dynamic?

 

If that's the case SDI doesn't support this - and TBH, I'm not sure if Apache webserver even has the ability to do SSI in JSON (im not sure what that syntax would look like).

 

View solution in original post

6 Replies
Umesh_Thakur
Community Advisor
Community Advisor

So why are you not going with the SDI way. this can be implemented in SDI with nocache or TTL based on your caching requirement.

You just need to put SDI config for a single or multiple component in publish runmode apart from basic SDI configuration. 

 

If you are looking for something else please explain.

 

Umesh Thakur

swapnilg7731718
Level 2
Level 2
@Umesh_Thakur : Does SDI work with json output rather than html also. I have sdi kind of requirement but with json as response rather than html
Umesh_Thakur
Community Advisor
Community Advisor

In this case can you com.adobe.acs.commons.http.headers.impl.DispatcherMaxAgeHeaderFilter with TTL for dispatcher like:

# Configuration created by Apache Sling JCR Installer
max.age="120"
filter.pattern=["path_pattern to json"]

 

we are using it for one dynamic json in our project.

 

Hope this will help.

davidjgonzalezzzz
Level 5
Level 5

If have a (reasonably 🙂) finite number of inputs producing a (reasonably) finite number of permutations of JSON - you could also look at using HTTP Cache [1] to cache the entire JSON output in AEM memory and serve it from there.

 

[1] https://adobe-consulting-services.github.io/acs-aem-commons/features/http-cache/

davidjgonzalezzzz
Correct answer by
Level 5
Level 5

SDI expects the output to be HTML.

Sling Model Exporter implies the output is JSON.

 

What exactly are you trying to do? Are you trying to stitch together a JSON response, where parts are static and other parts dynamic?

 

If that's the case SDI doesn't support this - and TBH, I'm not sure if Apache webserver even has the ability to do SSI in JSON (im not sure what that syntax would look like).

 

View solution in original post

swapnilg7731718
Level 2
Level 2
@davidjgonzalezzzz : your correct , that's exactly my requirement. Any other way to achieve this ?