3 ms·
I've used Paperclip in production. It's good and does what it's supposed to. The main issue is if you have a lot of different image sizes. It will basically pro
by gonyea 11y ago
I've used Paperclip in production. It's good and does what it's supposed to. The main issue is if you have a lot of different image sizes. It will basically process all of the images inline + store them to s3, etc. My ideal flow for image processing is to create the thumbnail (which the user sees right away) and to throw the rest of the image processing work on a background queue.
This minimizes the time spent processing a request and keeps the front-end snappy.
- hiphopyo 11y agoYou could do that with https://github.com/jrgifford/delayed_paperclip/ https://github.com/jrgifford/delayed_paperclip/ I guess.
- janko-m 11y agoThe part that I mind about both delayed_paperclip and carrierwave_backgrounder is that it doesn't really allow you to write your own job classes. This can be quite limiting for example if you want your jobs to send information to some monitoring services. Another part that I mind is the user experience. Ok, both of these gems allow you to know when the backgrond job is in process, and then you can display some placeholder image until the processing is done. But that's not really nice user experience. In Shrine the user immediately sees the image they uploaded, because it has that image already cached (usually on the filesystem), and then from the user's point of view the uploading is finished, before the background job even started. CarrierWave also has the cached image, but by design it's not possible to use it, while Paperclip doesn't cache images.
- madebysquares 11y agoThis looks like I very cool project, thank you for all the work you put in on it, I've definitely run into some of the problems you're trying to solve, and have come up with various custom-hacked solutions to make it work. I can't wait to try this out on a project.
- janko-m 11y agoI had exactly this scenario in mind when I was building Shrine. It has a recache plugin which allows you to do additional processing after validation but before storing, and then you can do the rest of the processing in a background job as part of storing. https://gist.github.com/janko-m/cfc50049c360d5c8be34 https://gist.github.com/janko-m/cfc50049c360d5c8be34