I have a question about the image resize billing. And obviously, I’m not the only one: Image Resizing Requests
The author in the previous post has the exact same issue, including the support pointing to a useless documentation page. I like Cloudflare a lot but I’m now very disappointed by a support team not being able to explain how a paying customer is billed !!
My current month invoice has more than doubled because of the image resize. But I nearly never add new images so after the first resize request, I shouldn’t be billed. Unless of course if any request on the resize URL is counted as a resize, which I would have a lot of trouble to understand as resized images are supposed to be cached (so included in the Cloudflare main offer).
Can someone explain to me?
Image resizing is billed this way. You have to add a caching layer in between, if you want to avoid multiple billings. This could be Workers, for example.
I admit I’m confused by this as well. If it’s cached, it shouldn’t be billed. I suspect this is the real question, and I bet the reality is pretty straightforward: The billed requests weren’t cached.
That other thread made it sound like the person though that if they set a cache TTL of one year that it would stay in cache. However, that’s not quite how caching works here. Cloudflare isn’t going to store an image in cache for a year just because one person requested it once. That’s a low demand image and will be purged most likely in a few hours. Certainly not more than a day or two. And every edge node is its own independent cache, unless it’s using Argo Tiered Caching.
OP here of the other thread
In my case the pages with the resized images receive thousands of requests per day. Items tend to stay cached.
I ended up removing all of the cloudflare image resize service use, and just resize images on upload and select the appropriate one. The billing started getting VERY expensive and it was actually slowing down our page speed scores. We finally got everything in the green once I stopped using the image resize service for things.
Thank you all, guys, I find the billing method a little bit unfair, not because of the way it’s done but because of the way it is explained (which means nearly not explained anywhere and I’ve been searching for the answer).
I think I will setup an automatic Nginx image resize location, working the same way as Cloudflare resize and thus resized images will be cached by Cloudflare … for free (or at least included in the subscription) this time.
1m45s later, Nginx resize works.
I received this morning a reply from the support. The key point is:
image resizing charges when there are cache misses
So all requests should not be billed, only requests with MISS which will lead to an image resize. I know that CF does use the cache headers returned by the origin, I’m starting to wonder whether I did set properly the cache on my origin server: I have an “expires 60d” setting in Nginx for these static resources but did it work fine actually? Not sure anymore, that could explain the invoice I got.
Too late to test this now, I switched to Nginx image resize. I might retry on CF one day in order to confirm this, not today. In the meantime, maybe some of you will be willing to double-check this.
I feel like that does not actually set
Cache-Control headers but an
Expires one, which might not be considered…
Thanks @matteo the “expires” directive for Nginx does set the Expires AND the cache-control max-age headers. So from what I can see in the CF doc, that should be used by CF
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.