A cookie notice loads on every page of your site, for every visitor. So every kilobyte it weighs, and every millisecond it keeps the browser busy, is paid for over and over again.
We rebuilt how ours loads. The banner looks and works exactly as before. It just gets out of the way much faster.
What changed
The old Cookie Notice was one file that every visitor downloaded in full: 75 KB, the banner, the settings screen and everything needed to draw them.
But most of your visitors have already made their choice. All they need is for that choice to be applied: analytics on or off, marketing on or off. They never see the banner again.
So the Cookie Notice is now two parts:
- A small loader that every visitor gets. It checks your settings, applies the choice a visitor already made, and stops there.
- The banner itself, which is only fetched when there is something to show: a first visit, or someone opening the cookie settings.
The numbers
| | Before | Now | |---|---|---| | Download for a returning visitor | 75 KB | 3.8 KB | | Download on a first visit | 75 KB | 24 KB | | Time the browser is busy, returning visitor on a phone | 46 ms | 2 ms | | Time the browser is busy, first visit on a phone | 76 ms | 29 ms | | Banner fully visible, on a slow mobile connection | 1.7 s | 0.9 s |
Measured with Lighthouse on a test page and on a customer's staging site, taking the middle result of several runs. Phone numbers use Lighthouse's slowed-down mobile profile.
The banner also appears 400 milliseconds sooner than it did: it no longer waits half a second before fading in.
What it means for your site
Less to download and less work for the browser, on every page, for every visitor. That matters most on phones and slow connections, which is exactly where a heavy script hurts.
Will it lift your PageSpeed score by itself? Probably not by much, and we would rather say so. The Cookie Notice was never the element Google measures for loading speed, and it never moved your layout around. On most sites, the score is decided by images, fonts and other scripts. What you do get is one script fewer to worry about.
What you need to do
Nothing. The code on your site stays the same, and so do your settings, the consent cookie and the events your analytics listen to. The new version is already live on your site.
The only browsers we no longer support are very old ones, such as Internet Explorer 11. They had stopped working reliably before this change.
Questions? Mail us at support@diffuse.tools.