Google Pagespeed ignores srcset on mobile
Asked Answered
I

1

7

Google PageSpeed ​​shows me an error "Properly size images" on mobile.

it loads the wrong link (mobile only): wp-content/uploads/2019/07/od-nave-yaad-1024x1024.jpg

What am I doing wrong?

<picture width="150" height="150" class="attachment-thumbnail size-thumbnail">
<source type="image/webp" sizes="(max-width: 150px) 100vw, 150px" srcset="wp-content/uploads/2019/07/od-nave-yaad-150x150.jpg.webp, wp-content/uploads/2019/07/od-nave-yaad-1024x1024.jpg.webp 1024w, wp-content/uploads/2019/07/od-nave-yaad.jpg.webp 300w">
<img src="wp-content/uploads/2019/07/od-nave-yaad-150x150.jpg" alt="" sizes="(max-width: 150px) 100vw, 150px" srcset="wp-content/uploads/2019/07/od-nave-yaad-150x150.jpg 150w, wp-content/uploads/2019/07/od-nave-yaad-1024x1024.jpg 1024w, wp-content/uploads/2019/07/od-nave-yaad.jpg 300w">
</picture>
Incursive answered 11/1, 2020 at 23:43 Comment(0)
P
0

Same issue... It does work if you use PICTURE tag:

    <picture>
        <source srcset="/uploads/pages/tymgenevo.jpg?w=480" media="(max-width:480px)">
        <img src="/uploads/pages/tymgenevo.jpg" alt="Team GENEVO" width="1110" height="399" class="img-fluid">
    </picture>
Photothermic answered 19/12, 2022 at 23:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.