On 23/03/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 04:52 PM 3/22/2007 +0000, Alan Kennedy wrote: > >But if the users want their "modern" python applications to be > >portable everywhere on WSGI, e.g. returning (iterable) files as ouput, > > Actually, returning a file as output is a horrible idea, since it will > massively reduce throughput, due to transmitting one line at a time to the > web browser. :)
FWIW, in mod_wsgi I have a directive which allows one to optionally override the prescribed WSGI behaviour of flushing after every chunk returned. Instead, the data gets buffered up by Apache and written as a large block rather than small blocks. Obviously you cant use this if you intend streaming data and probably not a good idea if something is returning a huge amount of data, but added it if for some reason you are using some third party WSGI component which is written in a sloppy way and generates lots of small blocks and you cant change it easily or quickly. With minimal effort the directive allows you to quickly improve throughput while you perhaps address the issues in the WSGI component or add on top your own middleware component which does the buffering in some other way which suits the actual application better. Graham _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com