carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.65k forks source link

Models with files attached are slow to save vs without files attached #2730

Open Amnesthesia opened 3 months ago

Amnesthesia commented 3 months ago

Saving a record that has anything attached with Carrierwave takes significantly more time to save than saving records of the same model that don't have anything attached yet

I'm not sure why this is, e.g if Carrierwave is automatically downloading the file and then saving it again

mshibuya commented 3 months ago

Most possible cause is #2461. If that's not the case, providing the uploader code will be helpful to track down the cause.

Amnesthesia commented 3 months ago

@mshibuya With or without head requests, should this really be necessary when saving fields on a record that don't touch the carrierwave field? Why should it need to do any requests at all when the file has not been touched?

mshibuya commented 3 months ago

CarrierWave doesn't do that, so it's likely that the problem is in your code. That's why I'm requesting you the uploader implementation.