Polish, not all images are converted to WebP

Hi,
I actived Polish, but not all images are converted to WebP, only some images.

Polish will only convert to WebP if the resulting file is smaller than the original JPG or PNG file. With most small images, WebP will be smaller, but on certain larger JPEG images with photographic quality, WebP may not be smaller than the original JPG.

Just to add, Polish does not work on the first request for an asset, but on subsequent requests it will. I created a test JPG on my origin, and issued two requests looking for the WebP version. Only the second request returns the WebP variant. Similar first response behaviour is seen with the Auto Minify feature.

% curl -H "Accept: image/webp" https://example.com/test.jpg --dump-header - -o /dev/null
HTTP/2 200
date: Mon, 27 Jul 2020 23:10:18 GMT
content-type: image/jpeg
content-length: 1790222
last-modified: Mon, 27 Jul 2020 23:10:18 GMT
cf-cache-status: MISS

% curl -H "Accept: image/webp" https://example.com/test.jpg --dump-header - -o /dev/null
HTTP/2 200
date: Mon, 27 Jul 2020 23:10:20 GMT
content-type: image/webp
content-length: 352068
age: 2
cf-bgj: imgq:85,h2pri
cf-polished: qual=85, origFmt=jpeg, origSize=1790222
content-disposition: inline; filename="test.webp"
vary: Accept
cf-cache-status: HIT
3 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.