Optimize streaming

Some reverse proxies allow applications to delegate actual download to the proxy:

  • with Django, manage permissions, generate files...
  • let the reverse proxy serve the file.

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]!

How does it work?

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
Read the Docs v: 1.4
Versions
latest
1.4
1.3
1.2
1.1
1.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.