programing

Google 페이지 속도가 모바일에서 srcset을 무시합니다.

newstyles 2023. 9. 26. 22:04

Google 페이지 속도가 모바일에서 srcset을 무시합니다.

Google PageSpeed에서 모바일에서 "이미지 크기를 적절히"라는 오류가 표시됩니다.

잘못된 링크를 로드합니다(모바일전용): wp-content/ uploads/ 2019/07/od-nave-yaad-1024x1024. jpg

내가 뭘 잘못하고 있는 거지?

<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>

같은 문제...Picture 태그를 사용하면 작동합니다.

    <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>

언급URL : https://stackoverflow.com/questions/59699693/google-pagespeed-ignores-srcset-on-mobile