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 ?
That is strange that webp does recognise webp because it recommends webp format for image optimisation.
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)
© 2022 - 2024 — McMap. All rights reserved.
.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