• Good morning,

    I’ve noticed that this plugin is loading all the full size images in a post during the page load, instead of waiting for user interaction with the thumbs.

    This is really a big problem, because that page loading takes really longer, and the user downloads a lot of unneeded stuff (expecially an issue if browsing from mobile).

    Also Google Page Speed Inisight seems to be really upset due to the longer page loading time.

    On the demo page on the Photoswipe website this isn’t happening, so I suspect that it is something related to this plugin.

    Moreover, if I recall correctly, I wasn’t experiencing this issue with some older version (unsure about that!).

    Currently, I had to disable it until this is fixed, or my website ranking in SERP would be possibly affected.

    Could you please fix it?

    Thank you in advance

Viewing 15 replies - 1 through 15 (of 20 total)
  • Sorry for the slow reply. We will look into this soon!

    I’ve made an issue here https://github.com/thriveweb/photoswipe-masonry/issues/26

    I’m not seeing this in the latest version. Could it be you just need to rebuild your thumbs?

    Please note: Images that are already on the server will not change size until you regenerate the thumbnails. Use AJAX thumbnail rebuild

    Thread Starter folettiwebdesigner

    (@folettiwebdesigner)

    Thank you for your answer.

    Nope, this is not a thumbnail size issue.

    In fact, the issue doesn’t regard at all wrong image sizes.

    It doesn’t even regard the images embedded in the page, but only the ones which are opened with a click on the embedded ones.

    Full size images should be LOADED only AFTER that an user click on the corresponding ones embedded in the article.

    Instead, at the moment, all the images (both the ones embedded in the article and the ones that are opened after user click) are loaded immediatly.

    For a live example, visit this webpage:
    https://www.c41magazine.it/james-marvin-lilac-hand/

    Keep your developer console opened in Chrome, and notice in the network tab how both all the full sizes images are loaded immediatly, instead of waiting for the user interaction with the embedded ones.

    If something is still not clear feel free to ask me again.

    Thank you in advance

    With this post your are only embedding single images right? Why not use the gallery mode?

    Thread Starter folettiwebdesigner

    (@folettiwebdesigner)

    Yes, only single images, for various reasons (faster conversion to PhotoSwipe for older posts, text between different images, featured images are single, etc.).

    I don’t know if the same problem affect also galleries, anyway, even if it wouldn’t, I think it needs to be fixed ASAP because it’s pretty crtical.

    Everything that affects so badly page loading times is going to bring heavy penalization in SEO and SERP, especially on mobile devices (downloading 6MB of page instead of 2MB is also bad for mobile max data limits).

    I don’t think it’s any different than embedding the image with no gallery. If you look at the source you can see WordPress now uses srcset by default, I’m not a fan of it and it’s heck of a lot of html junk.

    srcset=”https://www.c41magazine.it/wp-content/uploads/2017/02/Lilac-Hand-7-800×686.jpg 800w, https://www.c41magazine.it/wp-content/uploads/2017/02/Lilac-Hand-7-260×223.jpg 260w, https://www.c41magazine.it/wp-content/uploads/2017/02/Lilac-Hand-7-768×659.jpg 768w, https://www.c41magazine.it/wp-content/uploads/2017/02/Lilac-Hand-7-300×257.jpg 300w, https://www.c41magazine.it/wp-content/uploads/2017/02/Lilac-Hand-7.jpg 1200w”

    See how it works https://webkit.org/demos/srcset/

    Thread Starter folettiwebdesigner

    (@folettiwebdesigner)

    Ok, anyway, coming back to the issue… could it be done something about it?

    I don’t think there is an issue. You could try turning off srcset.

    https://mekshq.com/how-to-disable-responsive-images-srcset-in-wp-4-4/

    Or use the gallery feature of the plugin.

    jomo

    (@jonathanmoorebcsorg)

    Hi,
    there is an issue, it’s a fairly serious issue, also reported as
    https://github.com/thriveweb/photoswipe-masonry/issues/15
    though maybe not initially well understood.

    It’s not a thumbnail problem (so attempting to address it by lazy loading display of the thumbnails also doesn’t address the problem).

    The issue is that the plugin downloads the full size images as well as the thumbnails. (retested on release version)
    as above: “Full size images should be LOADED only AFTER that an user click on the corresponding ones embedded in the article.” which is what certain other plugins do.

    Instead, at the moment, photoswipe-masonry downloads all the images, both the gallery thumbnails and the full size images, as part of the page load, making an enormous payload.

    Generally on small galleries the user won’t notice if the internet connection is good, but on larger galleries it’s shocking, the difference between a <2MB page payload and a 40MB payload, depending on the number of images, and in the meantime the browser is spinning indicating to the user that the page download is not complete, even though the thumbnails etc may all be visible.

    If you got high res images, then turning on photoswipe-masonry increases your page load by MB for every photo in the gallery, it’s going to add up pretty quickly..

    Thread Starter folettiwebdesigner

    (@folettiwebdesigner)

    @jonathanmoorebcsorg this is exactly what I mean!

    If you try the demo on the official photoswipe website, the problem doesn’t occur instead.

    So it seems to be related only to this wordpress plugin.

    jomo

    (@jonathanmoorebcsorg)

    Oh yes you are right, it works well on the demo page, when you first open the lightbox it loads 3 full images, then as you start advancing through the gallery it starts loading more.

    It looks like there’s a simple fix to that, there’s a code block in photoswipe-masonry.js which forces all the full size images to load:

        $.each(items, function(index, value) {
          image[index]     = new Image();
          image[index].src = value['src'];
        });

    value[‘src’] has been previously set to the href for the full sized image so this codes is forcing the load of all the full sized images.
    If you comment it out, the normal and preferable photoswipe behaviour seems to be restored.

    Yes, I see this as well. Using developer tools > network, its really easy to see that the full size images are being downloaded directly. NO thumnails are being downloaded.

    This is fixed in the new version. Try the beta from here https://github.com/thriveweb/photoswipe-masonry

    jomo

    (@jonathanmoorebcsorg)

    @zehawk
    – no thumbnails downloaded is a different problem, it means you need to regenerate thumbnails, since photoswipe-masonry uses a different thumbnail size
    – the full download can be fixed by commenting out the code block I indicated above in photoswipe-masonry.js, but that will only avoid downloading the full size if you have the relevant thumbnail size images available
    – if your site has too many images to be able re-size conveniently, I have alternative code that uses the WordPress thumbnail size

    @jonathanmoorebcsorg, thank you, your point was very correct. After regen thumb, I can see that the thumbs are being downloaded. The other issue still remains for which I’ll try the beta version.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Serious performance issue’ is closed to new replies.