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

Manlio Perillo manlio_perillo at libero.it
Wed Dec 19 12:12:54 CET 2007

Phillip J. Eby ha scritto:
> At 11:51 PM 12/18/2007 +0100, Manlio Perillo wrote:
>> Phillip J. Eby ha scritto:
>>> At 10:10 PM 12/18/2007 +0100, Manlio Perillo wrote:
>>>> Ok.
>>>> Here I would just say that when someone install something on its 
>>>> system, it should at least know what he is doing.
>>> And I repeat: you're welcome to your opinions about what's good or 
>>> bad, but that has nothing to do with WSGI's design rationale, which 
>>> is based on *different* goals.
>> The problem is that I don't think that having many server 
>> configuration parameters with "safe" defaults value is against your 
>> design goals.
> Sometimes parameters are a necessary evil; that doesn't make them any 
> less evil, just more necessary.  :)

Ok, we diverge here ;-)

If a program does not have configuration parameters then:
1) the program is probabily very simple
2) the programmer thinks he gets the best values for program
    configuration, so that the user does not needs to interfere

Just a personal opinion, of course.

> However, if they aren't necessary, then they're just plain evil.  Range 
> support would be a good example of something where an option isn't 
> necessary, 

Ah, so the whole discussion originates from this misunderstanding :).

> since properly-written Range support in the server should be 
> able to tell when the application has already handled the necessary 
> range-ing of the output.  Thus, having an option to turn it on or off is 
> clearly a bad idea, as compared to making sure that the Range support is 
> correct in the first place.

As I have written in a reply, I wrongly reported that nginx interfere 
with range support implemented in the WSGI application.

This is not true: what `wsgi_allow_ranges` means is:
- by default nginx does not try to add support to partial requests, so
   this must be implemented by the WSGI application

- if you enable this directive, then nginx will add (basic) partial
   requests support for you

So this `wsgi_allow_ranges` is not strictly a "server" configuration; it 
can be view (somehow) as an application configuration, since nginx 
filters are similar to WSGI middlewares (and the WSGI application is 
embedded in nginx, thus not only the WSGI application can be viewed as 
an "extension" to the nginx server, but the WSGI server can be viewed as 
an "estension" of the WSGI application).

Manlio Perillo

More information about the Web-SIG mailing list