views:

279

answers:

3

I'm looking into supporting HTTP/1.1 Byte serving in WSGI server/application for:

  • resuming partial downloads
  • multi-part downloads
  • better streaming

WSGI PEP 333 mentions that WSGI server may implement handling of byte serving (from RFC 2616 section 14.35.2 defines Accept-Range/Range/Content-Range response/request/response headers) and application should implement it if announces the capability:

A server may transmit byte ranges of the application's response if requested by the client, and the application doesn't natively support byte ranges. Again, however, the application should perform this function on its own if desired.

I've performed some Googling but found little information upon which of the available WSGI servers/middleware/applications implement Byte-Ranges? Does anyone has an experience in the field and can hint me place to dig further?

EDIT: Can anyone comment, how I can enhance the question to be able to find an answer?

A: 

I'm not sure that i understand the question or not, but i think you're asking for software that implements said feature? If so, take a look at DownThemAll. It's a download manager plugin (http client) for firefix and it uses Accept-Range to download multiple parts of a file at once - thus speeding downloads up (in some cases).

Brian Dilley
The answer is offtopic. Question is about server-side, not client. Remove answer, please.
myroslav
Brian, you are correct. You don't understand the question. :)
Constantin
I'm not sure how it's off topic, but whatever. I'm willing to bet that the reason there are no answers is because it's a poorly written question.
Brian Dilley
+3  A: 

I think webob may do the trick, see the end of the file example for a range request implementation which efficiently seeks into the file being served.

Michael Twomey
A: 

You just need to use WebOb and create the response as Response(conditional_request=True) or subclass the WebOb Response object making conditional_request=True the default.

When conditional_request=True and the request asked for a range, WebOb's Response.app_iter_range wraps the complete response to return only the requested range.

The WebOb file serving example shows how you would implement your own app_iter_range for cases where it is practical to get a range of bytes without generating the whole response.

joeforker