I'm trying to Gzip the output from my app and it looks like the
headers are not being properly set when I deploy the code to the goog
servers. Everything works fine locally.
This is how I'm setting the headers:
self.response.headers['Content-Encoding'] = 'gzip'
self.response.headers['Content-Type'] = 'text/html'
buf = compressBuf(htmltop+status+htmlbottom)
self.response.headers['Content-Length'] = str(len(buf))
self.response.out.write(buf)
Request to my local machine,
nc localhost 8080
GET / HTTP/1.1
HTTP/1.0 200 OK
Server: Development/1.0 Python/2.5
Date: Thu, 17 Apr 2008 01:45:46 GMT
Cache-Control: no-cache
Content-Encoding: gzip
Content-Type: text/html
content-length: 2117
Request to the deployed code, notice that the Content-Encoding and
Content-Type headers are missing,
nc
myapp.appspot.com 80
GET / HTTP/1.1
Host:
myapp.appspot.com
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/html
Server: Google Frontend
Content-Length: 2062
Date: Thu, 17 Apr 2008 01:44:29 GMT
Cheers,
Andreas