Documentation

Table of Contents

Cache, Speed and Other Optimization of the iubenda Cookie Solution

This article refers to the latest version of the Cookie Solution. If you haven’t already, we strongly recommend that you upgrade your Cookie Solution by simply copying the new code here (Dashboard > [Your website/app] > Cookie Solution > Embed) to avoid any CSS related conflicts and to access all the new features of the latest version. Alternately, you can find the old guide related to the legacy version here.

If you would like to use a specific version of the iubenda cookie solution, you simply need to insert the following link in lieu of the one normally used in the Cookie Solution:

https://cdn.iubenda.com/cs/versions/iubenda_cs-1.8.2.js

The “1.8.2” value must be substituted with the number of the version to be used. Available versions are found in the Current and Stable channels, starting with version 1.3.11 (consult the complete changelog for a listing of all released Cookie Solution versions).

Unlike the default link, the link mentioned above has a very extended cache configuration as it points to a specific version which does not require future modifications.

By applying the modification described above to the Cookie Solution, the iubenda_cs.js resource will load a new file containing the desired version. It’s a best practice, also adopted by Google for the loading of Google Analytics, as a way to achieve a compromise between the need to update the Cookie Solution and the loading/cacheing speed. The iubenda_cs.js file is in fact a file with a brief cache of few bytes, which in turn calls the real Cookie Solution, whose cache is much more extensive.

Alternatively, you can bypass iubenda_cs.js and directly load the file with the hash of the version and you will be able to:

  • Eliminate an intermediary passage (resulting however in an almost negligible gain of a few milliseconds)
  • Access a version of the file with a very long cache

Direct loading of the Cookie Solution

If Google PageSpeed provided you with a suggestion similar to the following, we can help you solve the problem:

Look through the browser’s cache: If there is a maximum age for statistic resources in the HTTP headers or if an expiry date is set, the browser will load the the resources previously downloaded from the local disk instead of from the network.

To bypass iubenda_cs.js, you’ll have to get the hash from the desired version. As we saw before, visit https://cdn.iubenda.com/cs/versions/iubenda_cs-1.8.2.js and substitute “1.8.2” with the version of the Cookie Solution you wish to activate (if you wish to activate the last available option, head directly to the following address).

For example, if we take version “1.8.0” visiting https://cdn.iubenda.com/cs/versions/iubenda_cs-1.8.0.js we will have e.src="//cdn.iubenda.com/cookie_solution/iubenda_cs/core-045e8b0836594fa3f80e71e4479e37b3.js" which is, in the end, the URL of the file with the hash of the desired version:

https://cdn.iubenda.com/cookie_solution/iubenda_cs/core-045e8b0836594fa3f80e71e4479e37b3.js

Note

If you decide to block the iubenda Cookie Solution at a specific version, we suggest that you manually update it so that you may continue to benefit from our updates.

Direct inclusion of the activator inside the page

It’s possible to include the part of the code relative to the scripts, directly in-page (inline); this code is known as the inline activator. Scripts can be activated through the inline activator even if the iubenda_cs.js primary resource is generically unavailable or in error.

For more information and code samples, see Banner and Prior Consent – Setup and Customization.

(Optional) Suggested settings for performance optimization

By decreasing inlineDelay value (integer, milliseconds, default 500), you will reduce the total time of activation.

Keep in mind that inlineDelay works only with the “-inline” block, so it is reduced only to that kind of snippet. Its default value is 500, but we recommend to not set under 300.

It is highly recommended to check the activation of the snippet shown on your page if this setting is changed.

See also

Still have questions?

Visit our support forum Email us