Hacker News new | ask | show | jobs
by Lukas_Skywalker 1738 days ago
It would be great if they also allowed reverse proxying images directly. I.e. if I could embed an image like this:

<img src="/images/logo.png?size=200,200">

For the customers that enabled Cloudflare proxying, they could automatiacally serve a 200x200px variant of the image hosted on my server at /images/logo.png.

This would allow to use the feature without needing to upload the images explicitely.

For those not using the Cloudflare proxying, the images could be embedded using something like this:

<img src="https://imageproxy.cloudflare.com/mysite.com/images/logo.png...">

1 comments

This is already supported.

You create a worker that understands your URL scheme, and requests images via Cloudflare with the desired size/parameters: https://developers.cloudflare.com/image-resizing/resizing-wi...

Or, you can just use Cloudflare's built-in URL scheme for resizing arbitrary URLs: https://developers.cloudflare.com/image-resizing/url-format

Indeed. I only read the blog post, where this info is missing. Thank you.
If I understand correctly, then Cloudflare's paradigm is: We have a bunch of polished, simple standard services and if you want to do something slightly different and/or do something on the network you can use Workers.

I think it's pretty smart and empowering as it strikes a nice balance between great, simple DX and high flexibility.

Most of their new products are also built on Workers. Most of them were already possible before, just with more manual work.
Currently "Image Resizing" requires the Business plan or higher, so this strategy will not work for most hobbyist. Seems like enrolling into "Cloudflare Images" does not give a way to use this feature from Workers.