Images migration from R2 to Cloudflare images
Hi everyone, I need help for image transform services, I used to use
image resizing
(legacy) to resize images stored on R2 on-the-fly, which is pretty cheap (1$ per 50.000), but it is deprecated and changed to Cloudflare images
transform, which cost 25x more (1$ per 50.000 vs 1$ per 2.000).
Base on the docs: https://developers.cloudflare.com/images/pricing/, the optimal way now is migrate the images in R2 to cloudflare images storage & create variants for them (as variant is not count to pricing). I tried Sourcing kit
but it's not working, only S3 is supported, Can anyone help me to point out how to do the migration?
Thanks in advance!4 Replies
, I used to use image resizing (legacy) to resize images stored on R2 on-the-fly, which is pretty cheap (1$ per 50.000), but it is deprecated and changed to Cloudflare images transform, which cost 25x more (1$ per 50.000 vs 1$ per 2.000).There's a key part you're missing: the new pricing does not charge you for resizing the same image w/ the same settings twice. So for some people it's a huge amount less billed. You can resize the same image w/ same settings 10 million times and it's only one billable transformation
the optimal way now is migrate the images in R2 to cloudflare images storage & create variants for them (as variant is not count to pricing).You still pay for each image delivered, variant or not. I think R2 could still be cheaper in a lot of cases with the new pricing
I tried Sourcing kit but it's not working, only S3 is supported, Can anyone help me to point out how to do the migration?Yea afaik it's strictly S3 only. If you really wanted to migrate you might just have to write your own simple script using some S3 SDK to List() R2 and then you could batch upload into Images: https://developers.cloudflare.com/images/upload-images/images-batch/. I would do the math first though, with the new pricing: https://blog.cloudflare.com/merging-images-and-image-resizing/ counting only unique transformations, is it more expensive for your use case? You could always use Image Resizing to transform your images on upload and upload a few versions to R2 and then you'd just pay R2 costs
@Chaika Thanks for your answer, for more details, we currently have about 200k images with 3 different transform variants, counted 600k transforms per 30-days sliding window, images will be available for access for about 5-6 months, so we need to pay ~300$ per month, in the past, I think it only cost about 50-60$, do you have any idea to optimize the cost without pre-transform?
I hope cloudflare has transform analytics, so we can have more insight and adjust our current product, the only thing we can see now is amount of the image transformed per day.
Thanks!
I hope cloudflare has transform analytics, so we can have more insight and adjust our current product, the only thing we can see now is amount of the image transformed per day.If you have pro or higher you get Web Traffic Analytics and you can do
Path starts with /cdn-cgi/image
and see all of the pathes/most popular/etc. Otherwise you just get the amount of unique transformations per day with the new one
we currently have about 200k images with 3 different transform variants, counted 600k transforms per 30-days sliding window, images will be available for access for about 5-6 monthsThat makes it sound like each unique image is requested exactly once per variant and no more requests?
Wow thanks for the guide, never thought of it.
Based on current statistic, each image variant is request about 700 times in 72 hours, but new product will take place in first page everyday, so rough estimate should be around ~4000 request in 30-days sliding windows for each image variant.