Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    This is not currently possible within the plugin settings, but you can return false through the eio_do_lazyload filter to do such a thing.

    If you’d like to see that in the UI, you can submit a feature request: https://ewww-image-optimizer.hellonext.co/

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    Hi

    many thanks for the reply.

    I’m really not sure how to ‘return false through the eio_do_lazyload filter’!

    If you could explain how to do that for this page I’d be grateful:

    https://www.broughtonschoolofmotoring.com/driving-lessons-beginners

    Plugin Author nosilver4u

    (@nosilver4u)

    The code necessary would look something like this:

    function bsm_skip_lazyload( $value ) {
       if ( false !== strpos( $_SERVER['REQUEST_URI'], 'driving-lessons-beginners' ) ) {
          return false;
       }
       return true;
    }
    add_filter( 'eio_do_lazyload', 'bsm_skip_lazyload' );
    

    And just repeat the if ()… section for any other pages, making sure “return true” is at the end to keep lazy loading active for everything else.

    You can put that in your child theme functions.php or a basic plugin like I show here: https://ewww.io/2016/03/16/ewww-image-optimizer-filters-part-1/

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    Hi

    many thanks for the code.

    I’ve put it my theme’s functions.php yesterday but the image at the top of the page is still being ‘lazy loaded’, according to PageSpeed Insights.

    Will it just take a bit of time for the lazy loading to be removed from this page?

    The reason I’m keen to get this image loaded quickly is that lazy loading the image results in the Largest Contentful Paint time being excessively long.

    Plugin Author nosilver4u

    (@nosilver4u)

    It should be immediate, so long as you flushed any page caching, since the lazy-load parser runs on every page load (except cached ones). We can do some debugging via the support channel to see if this is working or not. Let me know if it still seems to be lazy loading on that page.

    There is potentially another solution (or two) that might address what you’re trying to accomplish:
    1. Using the eio_lazy_fold filter to skip a certain # of images on all (or specific) pages.
    2. Simply exclude the header images that you don’t want to slow things down. That much can be done right in the Lazy Load settings already.

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    Cheers

    I’ll have a go at excluding the image in the Lazy Load settings. This is the image url:

    https://www-broughtonschoolofmotoring-com.exactdn.com/wp-content/uploads/Driving-lessons-beginners1.jpg?strip=all&lossy=1&resize=836%2C417&ssl=1

    What should I put in the exclusions box?

    Plugin Author nosilver4u

    (@nosilver4u)

    Just the filename is usually sufficient: Driving-lessons-beginners1.jpg

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    Ok!

    I don’t have to do that – clearing the cache has done the trick. I forgot to do it after I added the code.

    But that image is still taking too long to load.

    I’ll try to make the file size smaller.

    Plugin Author nosilver4u

    (@nosilver4u)

    It’s only 39kb with Easy IO, shouldn’t be too bad?

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    Yes, it should be ok.

    The image only takes 32ms to load according to GTmetrix but 4.5 seconds according to PageSpeed!

    I think I prefer GTMetrix ??

    Plugin Author nosilver4u

    (@nosilver4u)

    Just ran some “real world” tests myself, and that page is screaming. I would tell PSI to take a hike!
    It’s coming in at 400ms for me and about 3s for “fast 3g” in the Chrome inspector. Largest 2 files are font-awesome, but again, it seems pretty quick to me.

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    You’re right. I wasn’t concerned about it until I read a piece about Largest Contentful Paint being one of the key metrics that Google uses.

    There’s nothing else that can be done really apart from put the image further down the page but I don’t really want to do that.

    Plugin Author nosilver4u

    (@nosilver4u)

    I typically prefer GTmetrix also, but they both are prone to erratic behavior at times, especially with lazy-loaded images.

    Thread Starter stevethefootycoach

    (@stevethefootycoach)

    Thanks for all your help!

    Much appreciated ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Turn off lazy loading on specific pages?’ is closed to new replies.