Gzip Compression and munged headers

256 views
Skip to first unread message

aschobel

unread,
Apr 16, 2008, 9:55:58 PM4/16/08
to Google App Engine
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

aschobel

unread,
Apr 16, 2008, 11:44:57 PM4/16/08
to Google App Engine
I see this is already in the issue tracker.

http://code.google.com/p/googleappengine/issues/detail?id=198

Cheers,
Andreas

ma...@google.com

unread,
Apr 21, 2008, 1:47:26 PM4/21/08
to Google App Engine
Hi,
Currently, Google App Engine doesn't allow various headers to be set:
ACCEPT_ENCODING

Outbound request headers:
CONTENT_LENGTH, DATE, HOST, REFERER, USER_AGENT, VARY, VIA,
X_FORWARDED_FOR

Response headers:
CONTENT_ENCODING, CONTENT_LENGTH, DATE, SERVER, TRANSFER_ENCODING

This is an issue with the SDK, which should be updated to reflect the
behavior of the system when you upload your application. I have
updated the status of the bug to reflect this. Please feel free to
file a feature request for the ability to GZip responses.

-Marzia
Reply all
Reply to author
Forward
0 new messages