Reputation: 5478
I have a FileField that uses django-storages' S3BotoBackend to upload audio files to to Amazon S3. The audio files can be up to 10MB in size, and a user can upload multiple files in the same form. The upload time can be very long and blocks. In order to speed up processing, I thought about writing a custom storage backend that inherits S3BotoBackend and submits jobs to a beanstalk queue before uploading to S3.
Are there any easier alternatives to speed up the user experience?
Upvotes: 5
Views: 2243
Reputation: 33670
If you want to speed things up, you'll want to have your Web server more engaged with handling uploads. You can check out out the Nginx upload module for Nginx, though you can accomplish much of the same using any Web server.
For this approach, you'll configure a view that's going to receive a request once a file has been successfully uploaded by the user, which would then be the opportune moment to queue the file to be uploaded to S3.
This will allow you to asynchronously receive multiple uploads from a user and asynchronously send the files to S3, which should cover just about everything you could do to improve the file upload experience.
Upvotes: 3