• Resolved mcofficeadmin

    (@mcofficeadmin)


    Logos in the header on mobile are creating a large drag on page speed, and showing class=”wp-image-270157 lazyloaded”. I thought that images in the header were exempt from lazy load by default. Please help me fix this.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Georgi Ganchev

    (@georgiganchev)

    Hello @mcofficeadmin,

    The?data-src?and?data-srcset?attributes are part of the lazy loading functionality, where the actual image sources are only loaded when they’re about to enter the viewport.

    However, the fetchpriority="high" attribute is intended to signal to the browser that this image is of high priority and should be loaded sooner rather than later, which seems to conflict with the lazy loading behavior.

    It’s possible that there’s a misconfiguration or an oversight within the theme or plugin settings that’s causing this behavior, particularly on mobile devices. Mobile versions of websites can sometimes have different settings or optimizations in place to improve performance on smaller screens and slower network conditions.

    What we advise you is to set up a class for your image which will allow it to be excluded from the lazyloading. You can use the following filter applied in the functions.php of your active theme.

    add_filter( 'sgo_lazy_load_exclude_classes', 'exclude_images_with_specific_class' ); function exclude_images_with_specific_class( $classes ) { // Add the class name that you want to exclude from lazy load. $classes[] = 'test-class'; return $classes; }

    You can also exclude it from the Speed Optimizer > Media > Exclude CSS Classes from Lazy Load

    Best regards,
    Georgi Ganchev

    Plugin Support Gergana Petrova

    (@gpetrova)

    Hello @mcofficeadmin,

    Since we haven’t heard back from you in the past month, we will mark the topic as Resolved. You will still be able to post new replies should you need to do so.

    Best Regards,
    Gergana Petrova

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Header images are lazy loading’ is closed to new replies.