[Web-SIG] [extension] x-wsgiorg.flush

Manlio Perillo manlio_perillo at libero.it
Wed Oct 3 16:57:37 CEST 2007


Hi.

Nginx, in one of the headers filters, can do ETag and Last-Modified 
validation.

I want to be able to use this feature, so I don't have to use thirdy 
party solutions.

However with the current WSGI implementation this is not possible.

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.



The intent of this extension is to be transparent to the WSGI application.
In case of nginx mod_wsgi, the validation can be done by Nginx, but for 
generic WSGI applications this can be done by a middleware.


I don't know if this feature is feasible, since I have not yet 
implemented it, so I would like to receive some feedbacks.


Thanks  Manlio Perillo


More information about the Web-SIG mailing list