How long does it take for Tealium to flush the cache for new Versions to be served to browsers?

tim_yuen
New Member
tim_yuen
 
4 REPLIES 4
Highlighted

How long does it take for Tealium to flush the cache for new Versions to be served to browsers?

roshan_gonsalko
Employee Emeritus
roshan_gonsalko
Hi Tim, We have a TTL (time-to-live) on utag.js (the Tealium script that is loaded) of 5 minutes so users should only be waiting 5 minutes for a new version. Hope this helps!

How long does it take for Tealium to flush the cache for new Versions to be served to browsers?

Tealium Employee
Just to add to this, files with a 5 min TTL are: utag.js utag.sync.js 60 minute TTL: utag.sub.js 7 Days TTL: mobile.html All other files have a 30 day TTL, but if needed to be updated are cached busted. Adrian
Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

How long does it take for Tealium to flush the cache for new Versions to be served to browsers?

novikp
New Member
novikp

Is there a way i can force it to be cleared right away?  5 min kinda long, and sometimes i don't know if cache was cleared or not. Is there a way to know? thanks. 

How long does it take for Tealium to flush the cache for new Versions to be served to browsers?

UnknownJ
Occasional Contributor
UnknownJ Occasional Contributor

Hi @novikp,

There are definitely ways, it depends on your use-case.

For example, if your deployment uses utag.sync.js, you could make sure that the script reference includes a Math.random cachebuster (e.g. utag.sync.js?cb=0.54245424), and then have utag.sync.js write its current ##UTVERSION## value into a global variable, that's then used as a cachebuster on your request for utag.js. What that means is that every customer will be forced to download a fresh utag.sync.js with every pageview (so you lose cache efficiency there), but will always get the new utag.js if the published version has changed. This is not dissimilar to the way in which the individual tag files are cachebusted only on change, but it does impact performance due to the need to re-download utag.sync.js on every page.

Alternatively, if it's just for testing purposes, you can use thing like Chrome dev tools to disable caching of resources, or add an optional cookie-based cachebuster to the utag.js request that allows you to set a cookie to force a cachebusted request.

All things are usually possible, just depends on exactly what you need, and what cost (i.e. complexity, performance, changes to the way the resources are loaded) you can live with.