Pyramid, partial and resumable downloads, HTTP Accept Ranges

Skip to first unread message

Mikko Ohtamaa

Jun 28, 2022, 4:01:34 PM6/28/22

What would be an easy way to support partial downloads / resumes with Pyramid? Namely HTTP Accept Ranges come to my mind, but there could be others.

- Serving files directly from FS using FileResponse

- Using gunicorn as a web server


Theron Luhn

Jun 28, 2022, 6:28:23 PM6/28/22
Easiest way is to not do it :)  I try to offload downloads/uploads to a service like S3.  Let somebody else do the heavy lifting.  If authentication is needed, I’ll generate a presigned URL in Pyramid and redirect.

AFAIA, Accept-Ranges is the only real HTTP solution for resumable/multipart downloads.

If you’re using nginx in front of gunicorn (which you should be), you can have nginx cache the response and handle Range for you.  You could also skip Pyramid altogether and serve file directly with nginx, using the auth_request module if you need auth. 

If none of that is feasible, rolling your own FileResponse that handles Range shouldn’t be too difficult, although personally that’d be my very last option.

— Theron

You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Jonathan Vanasco

Jul 8, 2022, 1:52:18 PM7/8/22
to pylons-discuss
^ ditto
Reply all
Reply to author
0 new messages