Google page speed insight does not support webp images ?

我的梦境 提交于 2019-12-07 08:10:34

问题


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


回答1:


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




回答2:


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)



来源:https://stackoverflow.com/questions/42067885/google-page-speed-insight-does-not-support-webp-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!