[Web-SIG] serving (potentially large) files through wsgi?

Ian Bicking ianb at colorstudy.com
Mon Dec 17 19:21:39 CET 2007


Manlio Perillo wrote:
>> That is, if there is a range request and the application replies 200 
>> OK, you can change that and apply the ranges.  But if the application 
>> replies with 206 Partial Content then the range has already been 
>> applied and the server shouldn't do anything to it.
>>
> 
> Thanks, I'll think about it.
> 
> I have just added a wsgi_allow_ranges directive, without further 
> processing, since I'm assuming that an user can anticipate if a WSGI 
> application is able to process partial content and thus he can just 
> enable or disable the directive.

A case when you can't do this is if your application proxies requests to 
another process, with things like the range headers in-tact.  It could 
get back a ranged response, but the application wouldn't be generating 
that response.

The user shouldn't have to anticipate what an application can or should 
do, beyond what the spec says.  Especially stuff like this will just 
cause weird bugs that no one will notice until deployment, and even then 
the bugs will be hard to find (in part because range requests are 
something only a small set of clients send, and that doesn't generally 
include clients that programmers use to run tests).

-- 
Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org


More information about the Web-SIG mailing list