zlib, gzip and HTTP compression.

Michael Ströder michael at stroeder.com
Sat Jan 12 10:27:01 EST 2002


jj wrote:
> 
> Content-Length must be the length of original, before compression.
> So try
> 
> print "Content-Length: %d" % os.path.getsize("test.html")

Note that HTTP 1.1 keep-alives (requiring Content-Length header)
makes unbuffered streaming output of unknown length impossible
because your have to know the length in advance to produce the
correct header value.

Ciao, Michael.



More information about the Python-list mailing list