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

Manlio Perillo manlio_perillo at libero.it
Mon Dec 17 19:06:20 CET 2007


Ian Bicking ha scritto:
> Manlio Perillo wrote:
>> Chris Withers ha scritto:
>>> Manlio Perillo wrote:
>>>> 2) handle the range request in the WSGI application.
>>>>    Its not hard as long as you do not implement multiple ranges 
>>>> support.
>>>>
>>>>    If your object database supports seeks, this should be the most
>>>>    efficient solution.
>>> This is probably what's wanted. So, if a wsgi app does its own range 
>>> handling, the wsgi server won't interfere?
>>>
>>
>> Yes, it should not interfere (well, with mod_wsgi for nginx it *will* 
>> interfere if you enable the wsgi_allow_ranges directive).
> 
> You should be able to detect whether interference is allowed based on 
> the response status, shouldn't you?

Right.

> 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.



Manlio Perillo








More information about the Web-SIG mailing list