• Resolved lauratraveler

    (@lauratraveler)


    Hi,

    Is it possible to async/defer the CSS of the plugin? I’m getting ‘Avoid chaining critical requests’ in PageSpeed Insights and the /cookie-law-info-gdpr.css, cookie-law-info-table.css and cookie-law-info-public.css are on the list. I can’t imagine that all 3 CSS files are being needed for the first popup screen (the one with ‘We use cookies on our website to give you the most relevant experience’).

    The ‘Privacy Overview’ is not even present on the screen when the page loads in the browser, so I believe the CSS for the ‘Privacy Overview’ can be asynced/deferred without any issues. Also, another option would be to maybe combine some of the CSS files since they are pretty small?

    Which option would be best.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @lauratraveler,

    We can help with the custom development. Please try adding the code snippet here in your active theme’s functions.php.

    Thread Starter lauratraveler

    (@lauratraveler)

    Thanks @webtoffee. Unfortunately, adding this code to my child theme causes a bunch of issues with Cloudflare’s Rocket Loader 🙁

    Plugin Author WebToffee

    (@webtoffee)

    Hi @lauratraveler,

    Kindly elaborate the issue that you are having while using the code and also share the site URL.

    Thread Starter lauratraveler

    (@lauratraveler)

    Hi @webtoffee

    When using the code above in combination with Cloudflare + Rocket Loader on, I get ‘Avoid document.write()’ for Rocket Loader, ‘Minimize main-thread work warning’, and ‘Preload key requests’ for jQuery.

    If I switch Rocket Loader off, the jQuery becomes render-blocking and ‘Avoid chaining critical requests’ now includes a bunch of js files (including the cookie-law-info-public.js) while removing the cookie law info CSS files. Basically not a good trade-off.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @lauratraveler,

    Unfortunately, this is the solution we currently have in hand. We will be making improvements in the plugin as we go on.

    We will add your requirement into backlogs and will consider it during further improvements.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Async/defer CSS’ is closed to new replies.