TTL for custom JS files | Community
Skip to main content
Level 1
September 17, 2024
Question

TTL for custom JS files

  • September 17, 2024
  • 1 reply
  • 1095 views

Hi All

We have out custom JS file that's cached at the Adobe CDN. I noticed that its TTL is shorter than what we have for forms2.css and forms2.js.

Is there any chance we can increase the TTL for those custom files too? It would really help us out.

Thanks a bunch!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Disha_Goyal6
Community Advisor
Community Advisor
September 17, 2024

Hi @diptich2, where you have added this custom files?

Level 2
September 17, 2024

Hi Disha,
We have created this custom javascript for switching between Marketo forms on the bases of country values. This script is currently stored in our Marketo production instance under Design studio and it is also cached at adobe cloud as well. And we have used this js on our external website(for a Hosted Marketo form). However, currently the TTL(Cache control) is only 60, we want to increase this to 14400 (similar to forms2.min.js) so that the page performance can be increased.

 

SanfordWhiteman
Level 10
September 17, 2024

There are 2 ways to embed Marketo-hosted JS assets and you’re choosing the one that’s least conducive to caching.

 

If you include the JS with no query string, it explicitly expires after 60 seconds.

 

If you append the query param version (e.g. ?version=0) then the file doesn’t contain explicit expiration but is heuristically cached using the browser’s internal logic, i.e. the further you get from the file’s Last-Modified date, the longer it’s cached. This option suffices for the vast majority of cases.