Advanced Tutorials

Performance tips

3min

Improve performance with Preconnect

In addition to the standard integration instructions, preconnect tags can be added. Preconnect tags speed up future loads from a given source by preemptively performing part or all of the handshake (DNS+TCP for HTTP and DNS+TCP+TLS for HTTPS sources). This will guarantee an additional sprint in terms of opening the CMP and greater speed in disseminating consent, giving us an improvement in terms of user experience and performance on the advertising side with little effort. This is a simple addition to make in the head tag of your websites, adding the following two lines at the top:

<link rel="preconnect" href="https://cmp.pubtech.ai" />

<link rel="preconnect" href="https://cmp-assets.pubtech.ai" />

If you want to learn more, we leave you links to additional resources below:

Resource prioritization

To ensure a good user experience, it is essential to correctly prioritize resources. It is not the purpose of this documentation to talk about minification, compression and other measures that we highly recommend you follow, some of these are: File minification and compression (e.g. for scripts and images) Lazy loading - ensure that only the initial images are loaded immediately, while images at the bottom of the page can be loaded via lazy loading with the attribute to your img loading="lazy" tag, the same could be done with script tags, if a script is not essential for showing the content of your website it may be appropriate to load it using lazy loading logic. Avoid modifying the page with blocking javascript. These tricks could make a huge difference in the loading time of your website. Furthermore, resource prioritization operations can be performed using the async and defer tags for JavaScript files.

We leave you a useful link here for further information.