سؤال

Does anyone know the location of the rails image gem dragonfly's cache. I don't want to have to regenerate all the different sized versions of images each time I deploy.

I already keep the original files in shared and symlink them to each deploy, but can't work out where the resized versions are.

هل كانت مفيدة؟

المحلول

Dragonfly does not store resized images on disk, which is part of its appeal; it generates resized versions of the image on demand. This is very flexible, but it means that you could take a nasty performance hit if you're always serving images from your Rails processes. You should cache them using something like Varnish or a CDN for best performance.

نصائح أخرى

Actually Dragonfly does provide a to_file() method so you can definitely cache your images. If you are lazy like me and want to do it the easy way, check out the handy dragonfly_helper

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top