• Resolved dev

    (@devksec)


    Hello,

    We’ve added a JS file onto our site, via a snippet that adds it to the footer. The filename “header-loader.js” has been added into the Delayed JS file paths, however it’s not delayed.

    Does this need to be added another way for litespeed to delay the script? Others are working fine. Did try without defer in the script tags and moving to header instead.

    function header_js_loader(){ ?>
    <script defer src=https://site.com/header-loader.js”>
    <?php }
    add_action(‘wp_footer’, ‘header_js_loader’);


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

    (@qtwrk)

    you have defer attribute already , which will bypass delay

    Thread Starter dev

    (@devksec)

    That sorted it! Seems delay won’t work well with the script due to it trying to lazyload a video on “DOMContentLoaded”.

    Is there a recommended way to optimise an autoplay video with litespeed?

    Plugin Support qtwrk

    (@qtwrk)

    please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Snippet added JS file being ignored by Delayed settings’ is closed to new replies.