• Resolved Anonymous User

    (@anonymized-23173868)


    I have set the “Load JS Deferred” option to “Deferred”. I have then added some strings to the “JS Delayed Includes” option. I have an inline script that looks like this.

    <script type='text/javascript'> var url = window.location.origin + '?ob=open-bridge'; fbq('set', 'openbridge', '565019775934206', url); </script>

    So, in the “JS Delayed Includes” box I have set both “fbq” and “openbridge”. However, the inline script is not being delayed. It is being deferred and the inline stuff is base64 encoded. How do I get this to work properly?

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter Anonymous User

    (@anonymized-23173868)

    That makes zero sense though and is wrong. When I set “Load JS Deferred” and select “Delayed” all of my scripts are automatically delayed by default. I don’t have to put them in the “JS Delayed Includes” setting. They are automatically delayed. The “JS Delayed Includes” field is so that you can specify individual scripts which will always be delayed, regardless of the “Load JS Deferred” setting. As I said, if I set “Load JS Deferred” to “Deferred” and then add a linked script in the “JS Delayed Includes” setting, it works. It only does not work for inline JS.

    I’m not trying to be snarky here, but it doesn’t seem like you understand how the plugin works.

    • This reply was modified 1 year, 1 month ago by Anonymous User.
    • This reply was modified 1 year, 1 month ago by Anonymous User.
    Thread Starter Anonymous User

    (@anonymized-23173868)

    Haven’t gotten a reply so not sure if anybody is looking at this. But here’s a video showing the issue and how to fix it.

    Edit: A better video

    https://share.cleanshot.com/qcCP9zfq

    • This reply was modified 1 year, 1 month ago by Anonymous User.
    Plugin Support litetim

    (@litetim)

    @thekendog
    LSC is working in 1 mode only. You choose which mode is that, from https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred
    Based on the setting done the correct setting will be loaded.

    I understand that you want all scripts deferred and SOME deferred: but the include/exclude are loaded based on the Load JS Deferred.
    We have no plans(at least now) to change how it works.

    I hope I am clear now.

    Thread Starter Anonymous User

    (@anonymized-23173868)

    @litetim your response is a little confusing. What does this mean?

    I understand that you want all scripts deferred and SOME deferred: but the include/exclude are loaded based on theΒ Load JS Deferred.

    You said deferred twice. Did you mean delayed?

    Did you watch my video? Based on your response it doesn’t seem like you did. Is there another support person who can take a look at this? I don’t understand what isn’t clear about the bug I’m seeing.

    1. I set JS to be deferred
    2. I add a linked script to the delayed include section. It gets properly delayed.
    3. I add an inline script to the delayed include section. It does not get properly delayed.
    4. I showed you the bug in the plugin and how to fix it. When I implement it, things work properly.

    If some other support person can take a look at this and watch my video it would be greatly appreciated. I ended up having to buy Perfmatters because LS Cache doesn’t work properly.

    Plugin Support litetim

    (@litetim)

    @thekendog per your request I will tag my other colleague: @qtwrk
    πŸ™‚

    And you are right. I was wrong when I wrote deferred and SOME deferred πŸ™‚

    • This reply was modified 1 year, 1 month ago by litetim.
    Plugin Support qtwrk

    (@qtwrk)

    okay , please forgive my bluntness , if I am reading the whole thing correctly

    in the case : when Load JS Deferred set to Deferred , and you put something in the JS Delayed Includes

    expect: both external JS and inline JS in the JS Delayed Includes field to be delayed, while rest JS are deferred

    actual: only external JS is delayed , inline JS is NOT , which you expect it to be delayed as well

    Thread Starter Anonymous User

    (@anonymized-23173868)

    @qtwrk yes, that is correct.

    • This reply was modified 1 year, 1 month ago by Anonymous User.
    Thread Starter Anonymous User

    (@anonymized-23173868)

    Any update on this?

    Plugin Support litetim

    (@litetim)

    @thekendog closing this topic as you created a github issue. Your ticket got to developers and is waiting for an answer

    Thread Starter Anonymous User

    (@anonymized-23173868)

    @puregraphx it’s here:

    https://github.com/litespeedtech/lscache_wp/issues/831

    Seems like they are ignoring it which is frustrating. It’s an easy fix and the current behavior isn’t what you would expect it to be and doesn’t even match up with the instructions in the plugin itself.

    Plugin Support litetim

    (@litetim)

    @thekendog we are not ignoring you(we saw your Github messages and you got the same answer there). As I said from beginning: current code will not allow that to happen.
    Changing this now, will make other sites not work as expected.
    For now, if anybody want to use your fix feel free to apply the chnages.
    I will close this topic because I consider this as resolved.

    Thank you πŸ™‚

Viewing 11 replies - 16 through 26 (of 26 total)

The topic ‘JS Delay for Inline Script’ is closed to new replies.