Hello,
I've been testing ways to optimize my sites without having to use mod_pagespeed for a long time. I have tweaked the "regular" .htaccess file that I use for the majority of the sites I work on, and I've managed to get 80+ score on most of my sites. One of those tweaks is to make Apache look for a webp file when jpeg or png files are requested (this one is new, I've just implemented it today). It works with the Accept, Vary and Content-Type headers and works very nice; Chrome's Developer Tools correctly reports the file being served as a webp file instead of jpeg or png. I've compared file sizes and yeah, the server is dispatching the webp versions.
However, it seems that PageSpeed Insights is not correctly parsing --or doesn't accept-- the Vary header or is having some other trouble. My server correctly dispatches a Content-Type:image/webp and Vary:Accept headers if the client sends the Accept:image/webp header, and the webp file actually exists, but PageSpeed Insights insists that my images are not optimized. With this specific site it's a huge hit on my score, since it loads several images which unfortunately I can't make lazy loading.
So, how can I get PageSpeed to actually acknowledge that my images are optimized?
Site note: Webp is AMAZING. I've managed to reduce JPEG sizes down about 30%, and for PNG file it's even better, some of my PNGs went from ~70KB to ~6KB. I think the tradeoff of having Apache check if the Webp version exists is totally worth it, lowering CPU cycles due to less network packets transmission.