WebP Images With Polish Not Working

Hi,

I recently upgraded to the Pro plan and I’m trying to implement the Polish feature to enable webp image codec on suitable browsers. I’m using the lossless setting with Webp enabled of course.

However, it seems that my images are still loading as jpegs on all compatible browsers. I’m still also getting opportunity to use “next-gen formats” on Google Pagespeed insights, which suggests that the feature is not working.

I’m using Cloudflare + WP Rocket for caching and I have cleared both but the issue persists across all posts and pages.

This is my wordpress website: https://www.weseektravel.com

Since you chose Lossless, it looks like it won’t use WebP on a JPG, but it will on a PNG.

2 Likes

Does this mean Cloudflare’s WebP are larger than the existing JPGs?

I still am unable to see any WebP files loaded on any page, whether the original was PNG or JPG.

Also I’m still getting the recommendation from PageSpeed Insights for most posts.

Follow up: I’ve tried again with Polish lossy compression but Cloudflare is still not pushing any WebP images.

As before, if Cloudflare can’t make a WebP smaller than the source image, it will stick with the source image. Otherwise…

To sum up: If you have Polish and Mirage, that’s about as good as it gets. If Cloudflare doesn’t convert it, you’ve done an excellent job at compressing your images. If some page test is complaining that it’s not enough, then…they’re whining about nothing.

If I run a Lighthouse test on your homepage, your scores are awesome. Desktop (top) and Mobile (bottom):

p.s. That van is amazing!

2 Likes

Okay, thanks for the help. Looks like I probably won’t need the pro plan. All good, I’ll see how it goes for the month.

Haha thanks mate!

1 Like

If Cloudflare doesn’t convert it, you’ve done an excellent job at compressing your images.

i don’t think that’s correct, i have taken a 2 .jpg and converted online to .webp using 2 different online services both converters made a much smaller version webp (result same size).

So its not like Cloudflare could not optimise further, it just isn’t working
Polish: Lossy & Webp
Output jpg ( content-type: image/jpeg)


134kb .jpg


90kb .webp

134kb .jpg > 90kb .webp = 44kb reduction,

plenty of room for improvement, tried with a few other images.
I have CF PRO on 5 websites none output webp.

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Freefexperience.com.au%2F&tab=mobile
Pagespeed seems to think there is room for improvement as well.

I would say it isn’t working, but a nice checkbox in admin :smiley:

Note: at first i thought the well optimised theory is correct since we try to optimise before upload (ImageOptim) in WP (kraken.io) but free online converters reduce the file size a lot

Thanks for this update. I tested a few free WebP converters too and had a similar result, plenty of room for improvement.

I’m also using ImageOptim to optimise my images prior to upload. Could it be that Cloudflare’s Polish is not converting to WebP if Jpegs are already optimised, even if there is room for savings with WebP?

(Different hosting from last comment to check if it is server related)

i have placed all thumbnails that WP generated of image 10 total, 3 images get polished

cf-polished: degrade=85, origSize=285489, status=vary_header_present

  • Full size
  • …80x80.jpg
  • …150x150.jpg

all others show
cf-polished: status=not_needed

They are different sizes of the same image some are converted some are not,
Unfortunately NONE come out as webP.

1 Like

I’m wondering if anyone else is willing to take a look at this issue. It seems that webp is not working as intended.

This is the issue with that particular file.

https://developers.cloudflare.com/cache/reference/common-cf-published-statuses

vary_header_present : The origin web server has sent a Vary header with a value other than accept-encoding. If the origin web server is attempting to support WebP, disable WebP at the origin web server and let Polish perform the WebP conversion. Polish will still work if the accept-encoding is not the only header listed within the Vary header.

1 Like

Hi Michael,

I know that this is in regards to slavo’s example but I think this is a little bit beyond my understanding. Can you see any conflicts with my settings or script that would cause WebP not to work correctly?

Hey,

I’m having the same problem with this webiste https://smuff.ro
I’ve activated my pro account, and polish but it seems that it doesn’t want to serve WebP.

Your images have a no-transform cache-control directive, which is an instruction to intermediate proxies to leave the payload untouched.

% curl https://www.smuff.ro/resources/img/logo.png --dump-header - -H "Accept: image/webp" -o /dev/null --silent
cache-control: public, max-age=2592000, no-transform, proxy-revalidate, s-maxage=600

From the documentation:

Polish is disabled when the no-transform directive is present.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.