• Resolved sennevdp

    (@sennevdp)


    Hi,

    I have recently started using the EWWW Image Optimizer plugin on 2 major client websites. These are both major real estates websites with lots of high-quality pictures. Your plugin does a great job of compressing those images and adding lazy loading.

    However, I noticed recently there is a problem when people try to print a page: the images are not loaded. I found online that I can use the EWWW_IMAGE_OPTIMIZER_LAZY_PRINT constant to prevent this, but it seems this only works when people click the print button a second time. The first time people print the page the images are not shown yet.

    As you can understand, this is a major problem.. Is there any fix for this?

    I also found the following code so I can disable lazyload on the estate pages, but I would rather not as these are the image-heavy pages.

    $url = $_SERVER['REQUEST_URI'];
    $endofurl = substr($url, -7);
    if ($endofurl == "/print/") {
    	echo "..";
    add_filter( 'eio_do_lazyload', '__return_false' );
    $_GET['cornerstone'] = true;	
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    Hi @sennevdp,
    That is indeed the “normal” behavior when using the lazy loader and the EWWW_IMAGE_OPTIMIZER_LAZY_PRINT constant. It’s not great, but it’s a quirk due to the fact that not all the images can be loaded before the “print preview” opens. On the second load, the images will be cached by the browser, and they load fast enough that time.

    However, one workaround would be to have a “printable link” that links to https://mysite.com/my-page/?ewwwio_disable=1

    There is also the (probably better) option of using a “print friendly” version via a plugin. Any URL that ends in /print/ will be excluded from lazy load automatically and will thus have all the images loaded immediately.

    Thread Starter sennevdp

    (@sennevdp)

    Hi, thanks for the fast reply! I will look into one of these options as a solution. Thanks! Senne

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘EWWW lazyload not working on print (even with EWWW_IMAGE_OPTIMIZER_LAZY_PRINT)’ is closed to new replies.