Caching dynamically generated images on Heroku
For a list view of items, we have to dynamically generate (using RMagick/ImageMagick) icon images for every entry. This icon is then reused within the app. We thus want to omit generating it again, hence we should cache the image.
Ah right, our app runs on Heroku.
What is the best way to omit regenerating the icon? Some strategies come to mind:
- Caching with Memcache?
- Write file (and let Heroku/Varnish/Nginx) to the work?
- Use a gem like Jammit to store to S3? 开发者_高级运维
http://devcenter.heroku.com/articles/caching-strategies
Best bet is probably memcache add on and to use fragment caching. Possibly low level caching as another alternative.
精彩评论