Support » Plugin: GDPR Cookie Compliance (CCPA ready) » Add preload to litty.css to improve performance

  • Resolved froughtz

    (@froughtz)


    Going through Google’s PageSpeed test gave me recommendations to preload one of the CSS files of the plugin to potentially save a 1.8-second delay.

    The location of the file: gdpr-cookie-compliance/dist/styles/lity.css

    The recommendation: Consider using <link rel=preload> to prioritize fetching resources that are currently requested later in page load.

    Can you please add this in the next version of the plugin to improve the speed?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @froughtz,

    Thanks for using our plugins.

    Please read the related topic here: https://wordpress.org/support/topic/relpreload-lity-css-2/

    You can try to add the following code snippet to your functions.php in order to prevent loading Lity via JS:

    add_action( 'gdpr_enqueue_lity_nojs', '__return_false' );

    Alternatively, you can use our advanced hook to block the GDPR Cookie Compliance loading Lity assets, but in this case please ensure you’re loading the Lity CSS and JS by your theme, and you can add “preload” in this case:
    add_action( 'gdpr_disable_lity_enqueue', '__return_true' );

    Hope this helps.

    Why does it take 8 seconds for lity.css to load? Makes no sense… this is crippling my page load speed.

    This is interesting…

    Hello!
    This GDPR cookie compliance would be a very good little plugin, but unfortunately it slows down the loading of the website very much …
    Could this bug be fixed in the next version?
    Thanks in advance!

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @fopeij

    We plan to remove Lity from the plugin after Christmas break.

    In the meantime, please read the related topic here: https://wordpress.org/support/topic/relpreload-lity-css-2/

    You can try to add the following code snippet to your functions.php in order to prevent loading Lity via JS:

    add_action( 'gdpr_enqueue_lity_nojs', '__return_false' );

    Alternatively, you can use our advanced hook to block the GDPR Cookie Compliance loading Lity assets, but in this case please ensure you’re loading the Lity CSS and JS by your theme, and you can add “preload” in this case:

    add_action( 'gdpr_disable_lity_enqueue', '__return_true' );

    You can also use this static script injection if you find speed performance being affected:

    add_action( 'gdpr_cc_prevent_ajax_script_inject', '__return_true' );

    Hope this helps.

    First of all, thank you for your answer.
    I will try the suggestions, but I think this is only a partial solution, so I look forward to the improved version without Lity.
    Merry Christmas!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.