At 04:57 PM 10/3/2007 +0200, Manlio Perillo wrote:
>A possibile solution can be to add an extension `x-wsgiorg.flush`, a
>callable object that notify the WSGI gateway that it can flush the
>headers (if they are not yet be sent) or the output buffer (Nginx has
>this feature, however I have yet not understand how it works).
>
> start_response('200 Ok', [('Last-Modified', 'xxx')])
>
> ...
> environ['x-wsgiorg.flush']()
>
> return a-generator
>
>
>The WSGI gateway can now send the headers before iterating over the
>generator, and if the client content is up-to-date, the new content is
>never generated.
Now that I understand what this is for, I can explain why a WSGI
extension is not necessary to provide this feature. In a compliant
WSGI gateway, yielding an empty string from 'a-generator' is
sufficient to "flush" the WSGI pipeline.
I suggest that you read this section of the spec more carefully:
http://www.python.org/dev/peps/pep-0333/#buffering-and-streaming
_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe:
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com