This is unfortunate:
class HttpHeadersDict(validation.ValidatedDict):
"""A dict that limits keys and values what http_headers allows.
http_headers is an static handler key i.e. it applies to handlers with
static_dir or static_files keys. An example of how http_headers is used is
handlers:
- url: /static
static_dir: static
http_headers:
X-Foo-Header: foo value
X-Bar-Header: bar value
"""
DISALLOWED_HEADERS = frozenset([
'content-encoding',
'content-length',
'date',
'server'
])
Looks like I'm explicitly disallowed from setting content-encoding, which
means I can't serve gzipped assets from a static directory. (Really, I
don't understand why Google's CDN doesn't gzip them by default.)
I've got some giant JSON files (14MB) to serve for a project I'm currently
working on. I've tried putting them in my CherryPy app and letting it
handle the gzipping and caching, but then I get out-of-memory errors within
a few requests.
I like App Engine. I'd rather not be pushed to Heroku or to S3, but not
supporting gzip is just silly. According to the FAQ, gzipped content
should be served to whoever requests it
(https://developers.google.com/appengine/docs/python/runtime#Responses),
but that's clearly not happening for static assets:
Request URL: http://www.mapperino.com/scripts/routes/sanFrancisco.js
Request Method:GET
Status Code:200 OK
Request Headers:
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:www.mapperino.com
Referer:http://www.mapperino.com/?map=sanFrancisco
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3)
AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
Response Headers:
Cache-Control:public, max-age=600
Content-Length:14494473
Content-Type:application/javascript
Date:Thu, 21 Jun 2012 15:11:05 GMT
ETag:"TQGJPQ"
Expires:Thu, 21 Jun 2012 15:21:05 GMT
Server:Google Frontend
Of course, if anyone has any advice on making gzip work, I'd be happy to
hear it. =)
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/wvLxPt3hankJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.