If I request the image via https://example.com/cdn-cgi/image/format=auto/https://example.com/-/media/images/sample.jpg then the encoding is applied. The documentation makes it seem like Cloudflare Image Resizing and Cloudflare Polish are two separate features, but from what I can see, they both need to go via the /cdn-cgi/ path for the conversion to take place. Is this correct?
Thanks for your reply. I get that they are two separate services, but does Polish need to be utilised by requesting images through the /cdn-cgi/ path (as is definitely the case for Image Resizing). Or is there some other option available for Polish?
No, thatâs what Iâm saying. Polish is more-or-less a set-and-forget type of thing, unlike Image Resizing.
Polish is a one-click image optimization product that automatically optimizes images in your site. Polish will not be applied to URLs using Image Resizing.
Be sure that youâve purged all of the relevant images from your cache. Otherwise, Polish wonât do anything with them as youâll be seeing the old cached images.
With that said, with Image Resizing youâre forcing it to format the image as per the options you feed it. However, with Polish, it creates and caches a WebP version of the image and delivers it to the browser if the âAcceptâ header from the browser includes WebP and the compressed image is significantly smaller than the lossy or lossless compression.
No. Your image URL wonât change, and that includes the file extension. So a file example.com/image.jpg will not change to example.com/image.webp.
Look for the header Content-Type instead to make sure Polish has been applied. If a JPEG image is converted to WebP or AVIF, the header will show it.
The header CF-Polish will give you more details. Also, please note that Polish will not be applied to images with a âno-transformâ directive in the Cache-Control header.