Highlighted

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

Rookie Contributor
 
4 REPLIES 4
Highlighted

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

Employee Emeritus
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!
Highlighted

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, Tealium files have the following cache expiration (TTL):

  • 5 min TTL: utag.js utag.sync.js
  • 60 minute TTL: utag.sub.js
  • 7 Days TTL: mobile.html
  • 30 day TTL: all other files

Learn more about how Universal Tag (utag.js) files are cached in the browser.

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?

Rookie Contributor

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. 

Highlighted

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

Tealium Expert
Tealium Expert

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.