Downloading off the public folder takes 2 seconds.
Downloading the same file using the send_file method below takes nearly a minute.
def download
file = FileUpload.find params[:id]
file_path = Rails.root.join('private', file.name)
send_file(file_path,
x_sendfile: true,
disposition: 'attachment')
end
I have tried changing buffer size and so on but it's still extremely slow, slower than the database & send_data combination.
Apart from ditching Rails entirely, is there an simple solution to this?