• Resolved RicaNeaga

    (@ricaneaga)


    Hello!

    Just a question regardin the option “Enable defer of all JS files for PSI only [ Will use JavaScript to defer all JS files for PSI ]”

    Must it be made by using document.write()? Right now web.dev test flags it as an inappropriate method.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Raul P.

    (@alignak)

    Hello,

    If you enable that option, you are telling Pagespeed to load the script deferred, but you are still making it render blocking for normal users.

    This should only be used when your scripts need to be render blocking due to some inline code needing it, but you don’t want the impact on pagespeed.

    Bots can still read your page with deferred scripts because they don’t interact with some areas and it’s ok if javascript triggers errors, but normal users may need the script to be render blocking for all functionality to work.

    You have to test to see if you can defer everything, or not.

    Thread Starter RicaNeaga

    (@ricaneaga)

    Yeah, I understand that. My question was just about the method, meaning how it’s coded. web.dev says document.write() is a no go, I just hoped that the same thing can be recoded without using document.write()

    And yes, when I tick the “Enable defer parsing of FVM JS files globally” option, then also ticking “Enable defer of all JS files for PSI only” is redundant. But this means that jquery isn’t used at all on the page, only then the option “Enable defer parsing of FVM JS files globally” is usable ??

    • This reply was modified 4 years, 11 months ago by RicaNeaga.
    Thread Starter RicaNeaga

    (@ricaneaga)

    Also, hope at some point you’ll have time to take a closer look at the other thread I started… I mean at that Lazy Load plugin, to make it work better with your minifying techniques… https://www.ads-software.com/support/topic/conflict-when-minifying-a-lazy-load-plugin/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘document.write() – is it a must for Enable defer of all JS files for PSI only’ is closed to new replies.