• Resolved ilithio

    (@ilithio)


    Hi, is it possible to automatically set the preload on all featured images of my website? Not manually?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Rhys Wynne

    (@rhyswynne)

    Hi There,

    Nice idea ?? – it was mooted before and there were other solutions that defaulted to it, so I’ve never pushed for it really.

    However, I have got it in Release Candidate form: was meant to be tested but somebody who requested the featured didn’t answer my emails ?? – I’ve uploaded it to Github. Could you give it a try and let me know – https://github.com/rhyswynne/preload-lcp-image-wordpress? You can toggle the option to default preload the featured image on and off on the options page.

    I’ll push it in the latest release if it works as intended ?? – thanks!

    Thread Starter ilithio

    (@ilithio)

    A thousand thanks! I tried installing it but it doesn’t seem to change anything ?? pagespeed keeps telling me to ‘preload’ the image, as if it doesn’t see any changes…

    Plugin Author Rhys Wynne

    (@rhyswynne)

    Do you have a URL I can check?

    Thread Starter ilithio

    (@ilithio)

    sure: https://marcolivio.com/senior/scarica-gratis-mandala-gatti-cani-da-colorare-per-adulti-stampa-ora-il-pdf-e-colora/

    • This reply was modified 4 months, 2 weeks ago by ilithio.
    • This reply was modified 4 months, 2 weeks ago by ilithio.
    Plugin Author Rhys Wynne

    (@rhyswynne)

    It’s because of the CDN. It pulls it in not from the CDN, it pulls the image srcset not from the CDN but your main image is from the CDN.

    I think that’s why I didn’t bother with the thumbnails previously, as it was difficult to identify (as people have custom image size(s) which need to be factored in).

    Let me have a think about it. May park for a bit and ask a few people to see if there’s a potential solution.

    Thread Starter ilithio

    (@ilithio)

    Thank you! I am grateful for your availability! So if there is anything new I will be very happy to make changes! Thanks again!

    Plugin Author Rhys Wynne

    (@rhyswynne)

    Hi There!

    Okay. I’m a bit baffled, and I think the problem lies with however you connect with the CDN.

    When I get the main featured image (which uses the function wp_get_attachment_image_url()), the CDN connection plugin that is used on your site filters the URL from the Image URL on the site to the Image URL on the CDN uses. However, when I use wp_get_attachment_image_srcset() to get the srcset (which is needed in your case as the featured image is smaller), it returns the non-CDN version of the URL. Weirdly, they both use wp_get_attachment_image_src(), which filters both, so there’s something within the plugin you use to setup the CDN that says “ignore it from the srcset”.

    I’m marking this as resolved, as you’re going to need to speak to whoever makes that plugin, as I think that’s where the issue is. Happy to assist them in whatever they do :).

    Thread Starter ilithio

    (@ilithio)

    Thank you <3

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.