[Web-SIG] WSGI 2.0
Graham Dumpleton
graham.dumpleton at gmail.com
Sat Apr 7 01:50:36 CEST 2007
On 07/04/07, Clark C. Evans <cce at clarkevans.com> wrote:
> On Fri, Apr 06, 2007 at 12:08:17PM +1000, Graham Dumpleton wrote:
> | FWIW, in mod_wsgi I have now added a directive which allows one to
> | enable within a specific context that chunked transfer encoding should
> | be used for a response when a HTTP/1.1 client is being used.
>
> That's great ;)
>
> | At this stage is probably better than nothing given that WSGI doesn't
> | provide a way of enabling it.
>
> In your implementation, how would I indicate where the chunk boundaries
> should be? Or is this just a fixed size thing?
In respect of requirements in WSGI specification for flushing blocks
of data, mod_wsgi implements:
"""1. Send the entire block to the operating system (and request that
any O/S buffers be flushed) before returning control to the
application,"""
In Apache, each time a flush is performed it will send all buffered
data as a chunk.
Thus, if you are using a generator as the iterable, a flush is
performed after each block of data your application returns and so
each block of data you yield becomes a chunk.
Even were you to return a sequence as the iterable, a flush is
performed after outputing each block in the sequence and thus each
block in a sequence also becomes a chunk.
Graham
More information about the Web-SIG
mailing list