Expand my Community achievements bar.

SOLVED

Setting expiration headers on custom scripts

Avatar

Level 2

Hi there,

We are using Adobe Activation (DTM) on our website and we are suing the custom script capabilities of the page load rules to load scripts on the website for tracking purposes.

The issue is that these scripts are cached - of course - but without any specific expiration defined for them. As a result, it slows the page load and can be seen in the webmaster view with a warning on the website analysis with the message: "leverage browser caching for the following cacheable resources: http://www.assets.adobedtm.com/...."

Any tips on how to set up an expiration date for these custom scripts?

Best regards,

Marc-Anton

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Marc,

I was able to bring your question to one of our DTM engineers. They indicated any customers looking to modify their script headers should utilize the self-host option within DTM. This will allow you to host the DTM libraries on your own hosting environment and thus have full control of cache expiration. 

 

Cheers,

Jantzen

View solution in original post

5 Replies

Avatar

Level 10

Hi Marc,

My understanding is that DTM uses a cache busting technology when deploying via Akamai to the edge. This ensures the latest version of your rule/tool is loaded each time. I'll continue to look into this to see if there is any tips we can provide.

 

Cheers,
Jantzen

Avatar

Correct answer by
Level 10

Hi Marc,

I was able to bring your question to one of our DTM engineers. They indicated any customers looking to modify their script headers should utilize the self-host option within DTM. This will allow you to host the DTM libraries on your own hosting environment and thus have full control of cache expiration. 

 

Cheers,

Jantzen

Avatar

Level 2

Hi Adobe team,

In order to optimize the website page speed, we should fix this issue. Is there any other recommendation available other than going to "self host option within DTM"?

Thanks

Avatar

Level 3

The approach I followed to achieve browser cache busting and dispatcher cache refresh for self hosted launch library was to add dispatcher flush rules "/var/cq/dtm-reactor/clientlibs/.*\.js=/etc/clientlibs "  using ACS common package . and added cache control header for specific URL pattern in dispatcher vhost under mod_headers

 <IfModule mod_headers.c>   

                SetEnvIf Request_URI "\/etc\/clientlibs\/dtm-reactor\/.*\/launch-.*\.js" is_launchscript

                 Header set Cache-Control "private, max-age=900  env=is_launchscript

 </IfModule>

 

Hope this helps

Avatar

Level 10

The recommendation for this problem is to move to self-host. Adobe Launch may have other options available, but we won't know for sure until it reaches general availability.