TTL based on resourceType | Community
Skip to main content
Level 3
Mar 29, 2019 10:55 AM UTC
Solved

TTL based on resourceType

Hi All,

I am trying to implement TTL using acs aem commons and it's working fine if I configure it based on paths(Max Age) option.

I was looking for something if it has TTL configuration available per resourceType or template based?  Has anyone tried this thing.

Having resourceType based TTL can be helpful in my case because

I have all the pages stored at the top location e.g. [dispatcher-cache-root]/page-1.html(templateA)  [dispatcher-cache-root]/page-2.html(templateB) etc.  I want all of them to be configured with different TTL, if I go path based, I need to have *.html and once that's configured, any specific configuration e.g. /page-1.html is getting ignored and only generic one takes priority.

Thanks in advance!

Rachna

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Mar 29, 2019 11:10 AM UTC

With ACS-TTL, you could write a couple of custom filters & servlets with to apply configuration on your resource types rather than globally across project. In a nutshell, customize the ACS code.

E.g;

acs-aem-commons/bundle/src/main/java/com/adobe/acs/commons/http/headers/impl at master · Adobe-Consulting-Services/acs-a…

acs-aem-commons/DailyExpiresHeaderFilter.java at master · Adobe-Consulting-Services/acs-aem-commons · GitHub

3 replies

Level 3
Apr 4, 2019 9:28 AM UTC

Hi,

I have got TTL based on resourceType working and the implementation is very similar to acs-aem-commons class DispatcherMaxAgeHaderFilter.java

Thanks & Regards,

Rachna

Translate
Level 3
Mar 29, 2019 11:50 AM UTC

Hi Gaurav,

Thanks for your reply.

I already have SSI implemented which is similar to SDI and it has it's own challenges of invalidating SSI snippets on dispatcher and one of the reason, we are looking for simple solution like TTL.

I will try customising ACS code and will update here.

Once again thanks a ton, much appreciated!!

Regards,

Rachna

Translate
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Mar 29, 2019 11:10 AM UTC

With ACS-TTL, you could write a couple of custom filters & servlets with to apply configuration on your resource types rather than globally across project. In a nutshell, customize the ACS code.

E.g;

acs-aem-commons/bundle/src/main/java/com/adobe/acs/commons/http/headers/impl at master · Adobe-Consulting-Services/acs-a…

acs-aem-commons/DailyExpiresHeaderFilter.java at master · Adobe-Consulting-Services/acs-aem-commons · GitHub

Translate