[mod_python] PSP buffer?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Aug 12 14:03:49 EDT 2004


On Thu, 12 Aug 2004, Jim Dabell wrote:
>
> Unfortunately, that just repeatedly calls req.write(), which doesn't give me
> the opportunity to perform any operations on the result before it is sent to
> the client, or even output additional headers afterwards.  For instance, I
> can't find a way of producing a Content-Length header, or using content
> encoding to gzip the response body.

You shouldn't need to set content length because it will be set by Apache 
for you. Apache will decide wither to set it depending on the protocol 
version used and whether the client accepts chunked encoding.

If you want to gzip the response, the proper way to do this in Apache 2.0 
would be by implementing a filter rather than a handler, there is actually 
an example of how to do this in mod_python in the examples directory, 
though you will probably be better off using something like mod_gzip.

Grisha


More information about the Mod_python mailing list