Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top