Cloudflare Business Resizing images for WordPress site

So wasn’t sure where to ask really. I have used Cloudflare on free an Pro plans previously. But interested in the Cloudflare Business plan with a large interest in image resizing as how it talks about resizing on the fly and storing on their edge. So looking from this help I am a bit confused if it is as simple as just turning on and it will check the image sizes based on devices. Or where it mentions configuration options that one of these have to be used to actually enable the Clouldflare resize to work. And if so wondered if there is an existing worker or plugin that works well with WordPress to meet the configurations.

https://support.cloudflare.com/hc/en-us/articles/360028146432-Understanding-Cloudflare-Image-Resizing

Either way has to be done at the source. Something in your site needs to insert code to set the image size. It would seem to me that a well-crafted WordPress site would use srcset to do the same thing.

Ah ok a bit different to what I thought so lets say I use srcset. As that is more just having the server create say 3 sizes for product images. And for say product image may display a medium-small size on archive and have -200x300.webp ending for it’s name. Then when viewing the product it is -400x600.webp then if they add to cart uses the image with ending -100x150.webp these are example numbers but these are stored on the WordPress site at these values and not sure how you could link this to work with Cloudflare resizing and would that be a benefit linking it? Would they just effectively resize these again and add extra optimisations possibly?

That’s probably the only difference. scrset only uses existing images on the server, so it takes a bit more planning and work. Or for $200/month, you can have Cloudflare generate the files for you according to the code you put in your pages.

2 Likes

Thanks ok so if I was going to setup cloudflare resizing to handle all the resizing would I be right if I followed the below link example. Setting up this worker as they said and deploying then making sure my image urls use the new format https://example.com/image-resizing?width=80&image=https://example.com/uploads/avatar1.jpg that this would then result in Cloudflare resizing the image located at https://example.com/uploads/avatar1.jpg to fit the width 80px.

https://developers.cloudflare.com/images/resizing-with-workers#an-example-worker

As marketed, your description (just turn it on and Cloudflare will handle the rest) is exactly what I expected as well. And frankly, I’m not sure why it DOESN’T function this way. That would add value to site owners.

2 Likes