Skip to main content

cache-exp

When landing on your website, a visitor's browser must download your site's code, including the Kameleoon script. Page loading time is impacted by the code's length and the number of external resources to download (for example, images, CSS, and scripts). Caching reduces the loading time during subsequent visits: the website's code and all static resources are downloaded and put in the browser cache to improve performance.

Caching therefore improves the user experience. But there is a downside: if Kameleoon's script changes (for example, if you have launched a new experiment), old visitors who have already started their visit on your website (and already downloaded the previous version of the Kameleoon script) won't see the new experiment yet.

To avoid this problem, there is a flag in the Kameleoon script, Cache Expiration (TTL: Time-to-live), that asks a browser to take a new version of the script every 1.5 hours: the script embeds its own expiry date.

Note: Sometimes, even though there is a TTL in place, a browser can decide to ignore it (this is often the case on mobile browsers as they want to optimize performance). It depends on each browser's policy.