1
votes

I'm Using Adobe AEM 6.1. Now I want to use Sling Dynamic Include 3.0.

  1. Installed the Sling Dynamic Include on the Publish instance
  2. I configured the Dispatcher with help of the following Documentation:

I also added the /enableTTL "1" in the dispatcher.any file inside of the cache tag, and added the headers in the cache tag

 /headers
 {
    "Cache-Control"
    "Content-Disposition"
    "Content-Type"
    "Expires"
    "Last-Modified"
    "X-Content-Type-Options"
 }

The Sling Dynamic Include works good. But the Problem is that the TTL Parameter is ignored. And I know I need AEM Dispatcher 4.1.11 and higher to use TTL. Well I'm using Dispatcher version 4.2.2 with an apache 2.2. Maybe I need an higher apache version that the TTL works?

My understanding of the TTL is, that I want to cache a file for 5 min, so in this 5 min, the users always get the cached document, and after this 5 min the dispatcher delete the old cached file, and get a new one.

Have somebody any idea? How can I check what is going wrong? I don't get an error or something, just the TTL param is ignored.

Here The Working SDI Include in my HTML enter image description here

I think with the path is something wrong. After the "...ttl.html" is the resource Type "/cbz/components/elements/bookingcalendar". I think it should end by the .html. But I don't know why this is happen.

The Config

enter image description here

1
I haven't used Apache 2.2 in a while but as far as I know, the dispatcher is compatible with both Apache 2.4 and Apache 2.2. Just make sure you download the right version. They're listed separately for Apache 2.4 and Apache 2.2. Can you post your OSGi config for SDI?toniedzwiedz
I have added my config.Try it

1 Answers

0
votes

Judging by the HTML rendered, you're dealing with a synthetic resource.

As far as I know, until SDI version 3.1.2, the caching of such resources with TTL was not possible (see SLING-7785 due to the way the resource type was appended as a suffix. Although, to be honest, I'm not sure why you do get a cached document at all. It's hard to tell without looking at the dispatcher cache config.

I suggest you try upgrading SDI to 3.1.2 or higher and using the newly provided configuration.

On a side note, Cognifide no longer maintains the SDI documentation you linked to. The project has been donated to Apache Sling and the most up-to-date docs can be found on the official Apache Sling Website

I've noticed that the official docs do not yet describe this feature so I raised SLING-7914. If you get it working, feel free to contribute a short how-to guide.