• Resolved Earthstoriez

    (@earthstoriez)


    Litespeed cache lazy image loading + View port image (VPI) removes fetch priority high.

    I use the php function bellow to add fetch priority high to the post featured image, it doubles as our first image inside a cover block. After activating the lazy image option and the VPI the fetchpriorty=”high” HTML attribute is gone. This does not happen for the logo, witch still retains it.

    /*Set high fetch priority and disable lazy loading for featured image only*/
    function featured_image_fixes($html) {
        if ( !is_single() ) {
            return $html;
        }
        $remove = 'loading="lazy"';
        $add = 'fetchpriority="high"';
        $html = str_replace($remove, $add, $html);
        return $html;
    }
    add_filter( 'post_thumbnail_html', 'featured_image_fixes' );

    Please help us to add fetchpriorty=”high” back.

    The page I need help with: [log in to see the link]

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

    (@qtwrk)

    I am trying to reproduce the issue but failed

    could you please try set up a clean wp , and only install LSCWP , see if you can trigger it there ?

    Thread Starter Earthstoriez

    (@earthstoriez)

    Hi @qtwrk, thank you for getting back to us.

    Sure, we have a staging.earthstoriez.com site. I disabled all the plugins there, except Litespeed cache ( with our optimizations enabled) . Now the Logo has bot lazy and high fetch priority. Which does not sound very good.

    <img data-lazyloaded="1" src="https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256.png" data-src="https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256.png" class="custom-logo entered litespeed-loaded" alt="Earthstoriez logo" decoding="async" fetchpriority="high" data-srcset="https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256.png 528w, https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256-470x228.png 470w, https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256-200x97.png 200w" data-sizes="(max-width: 350px) 100vw, 350px" data-ll-status="loaded" sizes="(max-width: 350px) 100vw, 350px" srcset="https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256.png 528w, https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256-470x228.png 470w, https://staging.earthstoriez.com/wp-content/uploads/2023/05/logo_528-256-200x97.png 200w" width="350" height="169">

    The post featured image is only lazy loaded.

    <img data-lazyloaded="1" src="https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1.jpg" data-src="https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1.jpg" class="wp-block-cover__image-background wp-post-image entered litespeed-loaded" alt="" decoding="async" data-object-fit="cover" data-srcset="https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1.jpg 663w, https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1-470x254.jpg 470w, https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1-200x108.jpg 200w" data-sizes="(max-width: 663px) 100vw, 663px" data-ll-status="loaded" sizes="(max-width: 663px) 100vw, 663px" srcset="https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1.jpg 663w, https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1-470x254.jpg 470w, https://staging.earthstoriez.com/wp-content/uploads/2014/04/treelore-earthstoriez-1-200x108.jpg 200w" width="663" height="359">

    What should the expected behavior look like?

    Please help me to get out the most of litespeed cache.

    Plugin Support qtwrk

    (@qtwrk)

    the site is giving me 404 , and may I know what is the feature image code without plugin ?

    Thread Starter Earthstoriez

    (@earthstoriez)

    Thank you, i will avoid to use this features of this plugin. I am pretty sure it is the reason my staging site crashed. Luckily i did not test on the live site.

    Please close this as unresolved.

    Thank you for understanding.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘fetchprioity high’ is closed to new replies.