dargmuesli / nuxt-cookie-control

A highly configurable cookie banner for Nuxt.
MIT License
229 stars 43 forks source link

perf(components): optimize for LCP #227

Closed dargmuesli closed 4 weeks ago

dargmuesli commented 4 weeks ago

Discussed in https://github.com/dargmuesli/nuxt-cookie-control/discussions/225

Originally posted by **urbgimtam** August 14, 2024 When testing in LightHouse / pagespeedinsights in anonymous mode, there is a LCP penalty that seems tied to the Nuxt Cookie-Control banner. It displays the banner as the culprit, even in desktop. ![image](https://github.com/user-attachments/assets/1cdbd742-2632-405a-99e0-ef0cbf91ffbe) This seems to happen because of all the javascript work required to check if there is a previous cookie for cookie-control, and the whole setup to be displayed, which is fine. My question: is this just happening to me, or is this something that others are experiencing? If so, what can be done to mitigate it? (thanks for a great module, I really enjoy it)