CDN Images - Merge Two URL to serve image

Greetings!

We are new to the Cloudflare CDN section.

We would like achieve a solution something like, you might see a URL that looks like this: https://my-site.example-cdn.com/https://flowers.com/daisy.jpg/quality=auto. This URL would retrieve and optimize the image that exists at https://flowers.com/daisy.jpg.

How to configure this url composition in Cloudflare? - If anyone can help with step by step process.

Thank you,

DS

Hi, if you need exactly this url format, you can try to use worker for image resizing Resize with Cloudflare Workers · Cloudflare Image Optimization docs

otherwise you should be able to use url format

so the url would look like this:
https://my-site.example-cdn.com/cdn-cgi/image/quality=auto/https://flowers.com/daisy.jpg

1 Like

I have a related question, when we use URL Format, the image is served from the nearest Cloudflare data center to the user or from the origin?
In the first case, that still require an http request to the origin server. Any ideas as to how to avoid that little request?

Hi, Cloudflare internally uses Tiered Cache topology to serve images https://blog.cloudflare.com/introducing-smarter-tiered-cache-topology-generation/.

if tries to serve resized image from closet PoP to user, when image is not found in cache, requests goes to upper tier PoP closer to origin, does lookup in cache again and if it is a cache MISS, pull original image and resize.

Any ideas as to how to avoid that little request?
can you clarify what does little request mean?

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