Support » Plugin: Super Page Cache for Cloudflare » Image Resizing

  • Resolved 1001 Webs

    (@1001webs)


    Hello, thank you for an awesome plugin,

    Do you have any advice on how to implement Cloudflare’s ‘Image Resizing’?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi, Cloudflare image resizing is a separate service where you need to use Cloudflare image resizing URLs to show up your images. You need to manually change all image URLs to Cloudflare image resizing URL. Cloudflare Image result is not an automated plug and play service.
    You can learn more about it from here: https://developers.cloudflare.com/image-resizing/url-format

    Thread Starter 1001 Webs

    (@1001webs)

    Hi Saumya,
    I saw that, just wondering if you knew of a plugin available, or if I would need to write the functions myself.
    It seems like a very useful feature, and wouldn’t be that difficult to code, can’t understand why there isn’t anything readily available yet, are you planning on implementing it on your plugin in the future?

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Unfortunately no, there is no plugin for Cloudflare Image Resizing. But if you are looking for image optimization, you can use Cloudflare Polish (available in CF Pro plan) or may other plugins like Optimole, Imagekit, Shortpixel etc.

    The reason Imaze Resizing API of Cloudflare cannot be done in a plugin form is because it is very dynamic. you can request different size and quality of the same image with different parameter. So, what size of image is needed in which part of your site only you know and no system can predict it.

    That is why if you want to use the image resizing you need to implement that separately in your code.

    Thread Starter 1001 Webs

    (@1001webs)

    Serverbolt has a rough implementation on GitHub,
    could you have a look and let me know your thoughts:
    https://github.com/Servebolt/cloudflare-image-resize-WP

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Yes I just looked at the code and found absolutely no reason for it. As in that code the system is taking the width and height that was set for that image size and then passing it to the image resizing API which makes no sense to me.

    As in inside WP if you create a custom image size then WP itself will automatically create that image size and show it to the front end. Then if you have CF Polish enabled, that gets cached to Cloudflare.

    Image resizing API is useful in different scenarios. Imagine you have a custom backend where you upload product details for an eCommerce shop. Now you have a website, web app etc.

    So, what can be done is if you upload one big image in the backend and then use the image resizing API to serve the same image in multiple different places in multiple different sizes and format.

    But as WordPress itself has an ability to create custom image sizes, I really don’t see a benefit here as with custom image sitez + polish is a much better automated solution for image optimization and caching.

    Thread Starter 1001 Webs

    (@1001webs)

    Thank your for your valuable opinion Saumya, much appreciated!

    mecanik

    (@mecanik)

    Sharing this here since it was long overdue: https://github.com/Mecanik/cloudflare-image-resizing.

    It will not alter your existing images, just replace all the relevant URL’s to serve them via CloudFlare Image Resizing.

    For the sceptic ones: Image Resizing is very different compared to Polish. It performs way better.

    Enjoy.

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @mecanik,
    Thank you for sharing the link. But I am very well aware of your project but honestly, I do not personally use it on any of my site or my client sites. Here is why:
    1. When it comes to polish, you get unlimited image optimization bandwidth with CF Pro or above account. While CF image resizing is a product billed based on usage. So, the more image resizing you make the more money you need to pay which makes no sense and reduces the value of image optimization provided by CF.

    2. In WordPress if you are using a good theme you can already use add_image_size() to have properly sized images in your site everywhere. Also you can take advantage or srcset to provide different size/quality images for different screen sizes. So, the only think that is left is to make sure those already sized images are not being provided by the origin server and rather is being provided via CF CDN in an optimized way.

    On the other hand if you would have been using a Laraval or JS Framework-based project this image resizing would help a lot compared to polish as in that case the user can just upload one images and then you can use that same image in multiple places according to your needs. CF has also recently released CF images for that same purpose though.

    But in the WordPress space it doesn’t make much sense in my opinion.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Image Resizing’ is closed to new replies.