Use cloudflare images from different domains

Hello,

Currently, we have over 1.000 product feeds, from all kinds of websites (images from http, https, etc.). I would like to server all of the product images, ideally from a subdomein (images.ourdomain.com) and serve them completely optimized.

So, let’s say I get for product 1 an image from https://myshop.com/images/image12345.jpg and for product 2 http://webshop123456.com/images/img563452.jpg

I would like to serve both to my visitors, for example:
/image.ourdomain.com/cloudflare-optimization/?imageurl=https://myshop.com/images/image12345.jpg

Is something like that possible? And if so, how?

it’s not entirely clear, what you mean by optimizations, but it is possible in either way.

If you mean Polish, you don’t need to change URL to optimize images Cloudflare Polish · Cloudflare Image Optimization docs (if myshop* are your domains and configured on Cloudflare) or use workers to fetch images through your image.outdomain.com zone.

If you mean image resizing, then do the following:

  1. Enable image optimizations on image.ourdomain.com in a speed tab in Dashboard.
  2. Use transform rules Serve images from custom paths · Cloudflare Image Optimization docs to rewrite urls as you like

or use workers to do all url permutations as needed.

If you want to optimize images from other domains, please read #4 about the “Resize from any domain” option. It’s possible to resize from imageurl=https://anydomain

https://developers.cloudflare.com/images/image-resizing/enable-image-resizing/

For the Workers method, the worker itself determines which domains you can resize from. This is set near the end of this example:

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

I still don’t quite get it. I have 20 different domains, but i don’t want to use a pro subscription 20x. I would like to once pay for the image optimizations, where I can optimize on the fly (without dowloading/uploading) any image from any domain. For example by using:
https://mydomain.com/image-output/?image-size=100x100&imageurl=https://externaldomain.com/123.jpg

The speed tab you both mention, is domain based. We have around 1.3 million images a month, If I use the option to resize, I guess it will cost a lot (9 dollars per 50.000 requests), or is a worker cheaper?

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