Google page speed insight does not support webp images ?
Asked Answered
R

2

6

I am using webp images for my site,but Google page speed insight does not recognize it & hence doesn't give optimized result.Google page insight does not support webp images ?

For eg. http://cdn-gi.storehippo.com/s/548ee13cdb64e550191162b4/ms.slides/webp/585a2d21d679d2df1179c75b-2048x2048.png

Ramonaramonda answered 6/2, 2017 at 12:31 Comment(6)
You .png file is not in PNG format. It is considered not only impolite but also a very bad practice to promise one format and deliver another. Not to mention that support for Google's WebP format is spotty.Spicate
I guess author forgot to mention that he has passed content-type header as 'image/webp' so it is delivering the content that it promises. Only image extension is different.Hosier
yes, exactly right.i have passed "image/webp" as content-type while saving image to s3 as well as while sending file in response.Ramonaramonda
Here is PageSpeed result for an actual webp: developers.google.com/speed/pagespeed/insights/… all seems to be in order. In case of your file there probably is some content type / file extension confusion.Buonarroti
PSI is recognizing some of the webp images but it is not recognizing my most of the webp images. and even if I am checking the result for my website i.e link, it is not working and google page speed is not recognizing the images. i have used "content-type":"image/webp" in headers also.Ramonaramonda
@RahulVerma Have you resolved this anomaly?Mansion
H
0

That is strange that webp does recognise webp because it recommends webp format for image optimisation.

Hosier answered 7/2, 2017 at 15:19 Comment(0)
M
0

I was also struggling to find an answer to this behavior of Google PSI as I was also facing this same scenario on my website as well. Google PSI (Page Speed Index) was giving next-gen image recommendations while in browser we were getting webp.

In my case I was detecting user-agent(as only handful of browsers supports webp, find here) to target supporting browsers. But in case of Google lighthouse/PSI they have different user-agent(Chrome-Lighthouse), that is why our server was serving prev-gen image.

You can also verify this by running lighthouse in your browser and analyzing the UA in network calls made during the check. You will most-probably get somewhat like following string as UA

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Mobile Safari/537.36 Chrome-Lighthouse

TL;DR If you in any way using UA to detect browser for webp then include lightouse's UA also, then google will not show next-gen recommendation(if you really care about getting rid of that recommendation)

Mansion answered 30/8, 2019 at 10:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.