I had a client who I built a site for (ecommerce) that had a lot of high resolution images. (running about 500gb/mo). Cloudinary charges $500/mo for this usage and Amazon charges about $40. I wrote some middleware that I used to wrap my cloudinary urls with in order to enable caching. This is entirely transparent and still enables you to use all the cool cloudinary effect and resizing functions. Hopefully this is useful to someone!
I think using deasync()
here is janky but I couldn't think of another way to do it that allowed for quite as easy a fix.
I put something together to help with wysiwyg images that are saved on cloudinary as we were being hit by huge bandwidths.
Same concept as yours but caches content blocks in the model, also checks if the content changes
https://gist.github.com/stephencoe/a7a3581141582b02fc7e