• Resolved mrwindowsx

    (@mrwindowsx)


    I want to delay only my home/frontpage, but all the other pages are deferred, how to achieve it using this plugin? I already set deferred in the JS Setting page optimization, adding my js in the excluded list, everything works ok, and I add the excluded URI of my frontpage in the setting, and include all list JS that I want to delay. But it doesn’t work expected. Can you help me to achieve this?

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

    (@qtwrk)

    keep setting to defer , then add this code snippet

    add_action( 'litespeed_optm', function() {
    if (is_front_page() && is_home()) {
    do_action( 'litespeed_conf_force', 'optm-js_defer', 2 );
    }
    } );

    it should make the home page to be delayed while rest page following defer.

    Thread Starter mrwindowsx

    (@mrwindowsx)

    I try to use that code, and keep setting to defer, I also removing content in excluded URI in page optimization, but the result frontpage keep defering, not delay.

    Plugin Support qtwrk

    (@qtwrk)

    please go to toolbox -> debug setting -> set debug log to ON, debug level to advance, debug include URI, add test

    then go to toolbox -> log view -> clean up any existing log

    now open your page as https://domain.com/?test

    go back to log view again , copy paste and share the log via https://pastebin.ubuntu.com/

    Thread Starter mrwindowsx

    (@mrwindowsx)

    ok, you can check it here:

    Ubuntu Pastebin

    Plugin Support qtwrk

    (@qtwrk)

    10/16/24 11:05:23.942 [162.158.107.62:52262 1 qi1] [Conf] ** optm-js_defer forced from 1 to 2

    the log shows the conf js defer was changed to js delay

    please try grab the html source code with and without this code snippet, and do a compare

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.