Using flexible variants for private images

Hello! I was considering using CF images for user-uploaded playlist thumbnails for one of my apps (been using Workers for 2.5 years now for it!). Seeing as I use Cloudflare for nearly everything else that I work on, it would make sense to stay within the ecosystem (and would be the preferred option). However after keeping an eye on the docs for a nearly a year now it seems as though it’s still not a supported feature?

Would there be any sort of indication as to if this is something that is in the pipeline, or has the potential to be?

If there’s no indication, or if an official response on the feature isn’t do-able at the moment, what would be the best way to handle flexible private images:

  • Tackle it myself (within my app)
    • My initial thoughts was that maybe writing some kind of “middleware” could work, although it’d be a bit hacky.
  • Would using R2 + Cloudflare Image resizing be a good choice?
    • Personally, I feel the amount of setup with this option might be a bit too hefty for my use case, not to mention having to manage two services for a single feature
  • Use a different platform altogether for user uploads.
    • One option I found was BunnyCDN, however I’m unsure as to how their platform works and what their DX is like

Thanks for all the effort you guys put into your products! Your services are constantly evolving, and it’s made for a really smooth DX. Keep up the good work!

Hello jrbradnick

Cloudflare currently does not support flexible private images directly. However, Cloudflare’s Image Resizing feature, along with the R2 storage, could work to fit your use-case. This solution would require some initial setup but it gives you a lot of control over your media content.

An alternative could be to build your own solution within your app. This will allow you to have total control over how the images are handled, but it will require you to handle the complexity and challenges tied to software development and scaling the solution as your app grows.

Lastly, other platforms like BunnyCDN can be a good option but you will need to familiarize yourself with their platform and ensure it aligns with what you want to achieve.

Please note that Cloudflare is constantly improving and adding new features. It’s possible that they could support flexible private images directly in the future.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.