How do I get Cloudflare Image resizing working with Cloudflare Pages deployment preview URLs?
Is it possible to use Image resizing with Cloudflare Pages automatic deployment URLs? I want to be able to request an image like this...
https://4222d427.my-website.pages.dev/cdn-cgi/image/width=48,height=48,f=auto/_app/immutable/assets/test-6fef8284.jpeg
But currently, I need to merge to production before the image starts to work. Is there any way to get this working using the branch preview URL?
2 Replies
Hey @daveje. No luck, unfortunately. Either allow any origin in your image resizing and then make all the links absolute and use a base of your zone, or set up long-lived branch aliases (e.g. staging.example.com) per our docs and only expect images to work on those.
Thanks @veerooo, I was able to knock up a solution using absolute urls like you suggested