• Resolved adlt93

    (@adlt93)


    GTMetrix gives me a grade of F (same as before I installed litespeed cache) on defer parsing of javascript, even though in the setting for litespeed cache I have enabled it. I have also used “purge all” in manage>purge.

    Am I missing something? I don’t think it’s another plugin interfering since I don’t really have a great deal of plugins active yet…but I could be wrong.

    Report Number: GXSBYULB

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi @adlt93, we found some of your js still not load asynchronously (jquery.js?ver=1.12.4-wp’), can you send us the advance debug log (https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:debug) for checking.

    Thread Starter adlt93

    (@adlt93)

    Where should I send it? Should I just post it here?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    You can sent it [email protected] with reference to this post

    Or paste it somewhere like https://gist.github.com then provide the URL.

    You can remove the senstive information in log first, like your IP and domain.

    Best regards,

    Thread Starter adlt93

    (@adlt93)

    Ok, I just sent an email with the debug log and a link to this post.

    Thread Starter adlt93

    (@adlt93)

    I sent it two days ago and I haven’t received a reply? Did I send something wrong?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Apologize for the inconvenience.

    But I couldn’t find any related mail in our system.

    May I know what is the title you used in mail ?

    Also I just test your site again , it seems you have already fixed the JS defer issue on GTMetrix ? it’s showing grade A now.

    Best regards,

    Thread Starter adlt93

    (@adlt93)

    No worries!

    The e-mail title was “GTMetrix say I should defer parsing of javascript but setting is ON”.

    The grade changed because because I removed a youtube embed, but in reality the problem still persists, as shown by a .js that is still not being deferred.

    Thank you!

    Thread Starter adlt93

    (@adlt93)

    I still haven’t heard back…

    I embedded the youtube video again since we will be doing so in the future even though it won’t be this same exact video. And I figure it may help to have it embedded to solve the issue.

    So the GTMetrix score is back to an F.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    May I know how did you embed it ? I will try to reproduce the issue and check it.

    Best regards,

    Thread Starter adlt93

    (@adlt93)

    I’m using the Divi Theme Video module to embed it, so I’m not terribly aware of how specifically it embeds it.

    But the problem is, that there are other .js files other than the ones generated by embedding the youtube video that litespeed cache isn’t able to defer. So I figure the problem must be more general.

    Plugin Support LiteSpeed Lisa

    (@lclarke)

    I don’t know if this will change anything, but maybe you can try just putting the URL on a line by itself within your post. WordPress automatically embeds YouTube videos when you reference them like that. And maybe the way that WP embeds videos is different enough from the way Divi does it, that it avoids the issue.

    It’s worth a try ??

    Thread Starter adlt93

    (@adlt93)

    That might fix the .js generated by the video. But there are still other .js files that aren’t being deferred, that don’t have anything to do with the youtube embed. So clearly the option “defer parsing of javascript” in the plugin isn’t working on the site for some reason.

    I was wondering if it could be some other settings options interfering?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    OK , so now I see why it doesn’t work that youtube thing.

    It comes with iframe , so basically it’s like you open another page inside your page, which obviously, there is no way you can modify (defer) things that is NOT on your server.

    To confirm my theory

    create a HTML file , with code

    <iframe title="Divi. The Ultimate WordPress Theme And Visual Page Builder" width="1080" height="608" src="https://www.youtube.com/embed/FkQuawiGWUw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

    It’s the code Divi uses to embed youtube, and GTMetrix test this HTML file directly , you will see that JS defer warning.

    Best regards,

    Thread Starter adlt93

    (@adlt93)

    Hello!

    Yeah that makes sense. I just did a bunch on googling and that seems like a common issue, the solution seems to be lazy loading the video.

    But again, like I said, there are still two more javascript issues.

    First there’s inline javascript which I figure probably isn’t worth fixing on a relatively small website.

    But there is also a .js file “/jquery.js?ver=1.12.4-wp” that isn’t being deferred, and that one is in my server as far as I can tell. Any ideas as to why that one isn’t being deferred?

    Thread Starter adlt93

    (@adlt93)

    OK I fixed it, I had to change settings.

    (I’m writing this in case anyone has the same issue in the future)

    I just had to turn off “exclude JQuery” in the optimization settings of the LS Cache plugin.

    Thanks for all your help!

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘GTMetrix say I should defer parsing of javascript but setting is ON’ is closed to new replies.