• Resolved joy0114

    (@joy0114)


    Hi,

    Is it a good idea to defer instant_click.min.js, or it’s better to let it working as default ?

    I’ve got this question because pagespeed insight seems to show it’s delaying page’s display.

    Thanks.
    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support qtwrk

    (@qtwrk)

    yeah , it seems to be a good idea

    I did a quick test, and I can see instant click still works

    as temp solution you can use this code snippet

    function add_defer_to_instant_click($tag, $handle) {
    if ('litespeed-cache' === $handle && strpos($tag, 'instant_click') !== false) {
    return str_replace(' src', ' defer src', $tag);
    }
    return $tag;
    }

    add_filter('script_loader_tag', 'add_defer_to_instant_click', 10, 2);

    I will also forward this as feature request to our dev

    Thread Starter joy0114

    (@joy0114)

    Hi Qtwrk,

    Thanks a lot for your advice and snippet.
    Have a good day !

    Best regards

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

The topic ‘instant_click.min.js’ is closed to new replies.