Some reverse proxies allow applications to delegate actual download to the proxy:
As a result, you get increased performance: reverse proxies are more efficient than Django at serving static files.
The setup depends on the reverse proxy:
Note
Currently, only nginx’s X-Accel [1] is supported, but contributions are welcome [2]!
View return some DownloadResponse instance, which itself carries a file wrapper.
django-downloadview provides response middlewares and decorators that are able to capture DownloadResponse instances and convert them to ProxiedDownloadResponse.
Note
The feature is inspired by Django's TemplateResponse
Notes & references
[1] | http://wiki.nginx.org/X-accel |
[2] | https://github.com/benoitbryon/django-downloadview/issues?labels=optimizations |