-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explain how to use defer
to avoid render-blocking when using this library
#86
Comments
We should add some guidance to our docs about when to use the |
From Harry Roberts: According to WPT, The attached video shows the users’ experience, and this waterfall comparison shows the technical differences. Can we |
I believe this isn't as simple as just adding the defer tag to the cookie banner JavaScript. When trying it on the NHS website, the cookie banner works OK but the toggle page where you change your answers doesn't work properly. I think some code will need changing in the cookie consent solution. |
The NHS.UK toggle code isn't compatible with a |
The banner can be defered as long as any interaction with the cookie banner's exposed API is wrapped in a Further discussion and example implementation is in this merge request |
I think this issue is just a matter of explaining this best practice in the docs, as there's no code change needed. I'm going to change the issue title |
defer
to avoid render-blocking when using this library
https://www.webpagetest.org/video/compare.php?tests=190916_BZ_60f228bdf766f4f0a23e7be389decabe,190917_71_be05e3ef5dd8be1a16448425cd8b641d
This test proves that loading the cookie consent script interferes with loading the main content of the page. On a 3G quality connection or older, the load time increase is significant
The text was updated successfully, but these errors were encountered: