I'm using Amazon S3 to serve static files. When the Content-Type is just 'text/css' and I haven't compressed the file, it is returned ok. If I try to zlib.compress() the contents that will be returned and change Content-Encoding to 'gzip', the browser cannot decode the result. In Chrome, the error is
Error 330 net::ERR_CONTENT_DECODING_FAILED
in Safari,
“cannot decode raw data” (NSURLErrorDomain:-1015)
Is there something special to do with python's zlib to make sure the result can be returned and decompressed by the browser?