4 ms·
You may wish to investigate cloudflare's image API: https://developers.cloudflare.com/images/cloudflare-images/ https://developers.cloudflare.com/images/cloudfl
by eblume 3y ago
You may wish to investigate cloudflare's image API: https://developers.cloudflare.com/images/cloudflare-images/ https://developers.cloudflare.com/images/cloudflare-images/
If the reason you were unable to use a CDN cache was because your access patterns require a lot of varying end serializations (due to things like image manipulation, resizing, cropping, watermarking, etc.), then this API could be a huge money saver for you. It was for me.
OTOH if the cost was because compute isn't free and the corresponding cloudflare worker compute cost is too much, then yeah, that's a tough one... I don't have a packaged answer for you, but I would investigate something like ThumbHash: https://evanw.github.io/thumbhash/ https://evanw.github.io/thumbhash/ - my intuition is that you can probably serve some highly optimized/interlaced/"hashed" placeholder. The advantage of thumbhash here could be that you can optimize the access pattern to be less spendy by simply storing all of your hashes in an optimized way, since they will be extremely small, like small enough to be included in an index for index-only scans ("covering indexes"). (I have not actually tried this.)
- dekhn 3y agoI'm an AWS shop, running science code, cloudflare is not a product I would consider.