Accept-Encoding:gzip

2,173 views
Skip to first unread message

bsr

unread,
Mar 13, 2013, 9:32:40 PM3/13/13
to google-ap...@googlegroups.com
Hello,

I use Google Chrome, and can see the Accept-Encoding is set

  1. Request Headersview source
    1. Accept:
      application/json, text/plain, */*
    2. Accept-Charset:
      ISO-8859-1,utf-8;q=0.7,*;q=0.3
    3. Accept-Encoding:
      gzip,deflate,sdch
    4. Accept-Language:
      en-US,en;q=0.8
    5. Cache-Control:
      no-cache
    6. Connection:
      keep-alive
    7. Content-Length:
      2
    8. Content-Type:
      application/json;charset=UTF-8

But, the response is not gzipped. below is the server log of http header.

key: Cookie val: --
key: Origin val: --
key: User-Agent val: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22
key: Content-Length val: 2
key: Accept val: application/json, text/plain, */*
key: Cache-Control val: no-cache
key: Connection val: close
key: X-Appengine-Inbound-Version-Id val: 1.1
key: Accept-Charset val: ISO-8859-1,utf-8;q=0.7,*;q=0.3
key: Pragma val: no-cache
key: Referer val: ---
key: X-Appengine-Inbound-Appid val: dev~slot
key: X-Requested-With val: XMLHttpRequest
key: X-Appengine-Request-Log-Id val: --
key: Content-Type val: application/json;charset=UTF-8
key: X-Appengine-Inbound-User-Id val: 
key: X-Appengine-Inbound-User-Email val: 
key: Accept-Language val: en-US,en;q=0.8

I don't see   Accept-Encoding in the  header anymore.
" Other issue I've been running into is that the dev server never compresses the requests (which is inconsistent with the production server and should be regarded as a bug)."

Please let know is it indeed a bug, or not supported in dev env.

Thanks

David Symonds

unread,
Mar 13, 2013, 10:32:37 PM3/13/13
to bsr, google-appengine-go

bsr

unread,
Mar 14, 2013, 2:54:50 AM3/14/13
to google-ap...@googlegroups.com, bsr
Dave. thanks for the response. I couldn't get much info from the paragraph.
"Custom clients can indicate that they are able to receive compressed responses by specifying both Accept-Encoding and User-Agent headers with a value ofgzip. The Content-Type of the response is also used to determine whether compression is appropriate; in general, text-based content types are compressed, whereas binary content types are not."
I guess it only for Custom clients, and Nick clarifies it in SO post

So do you mean, in dev. environment doesn't support gzip or I need set user-agent.

thanks

On Wednesday, March 13, 2013 10:32:37 PM UTC-4, David Symonds wrote:
https://developers.google.com/appengine/kb/general#compression

bsr

unread,
Mar 19, 2013, 9:54:01 AM3/19/13
to google-ap...@googlegroups.com, bsr
Sorry, anyone please comment on what Dave implied.

thanks

Julius Kovac

unread,
Mar 19, 2013, 12:32:17 PM3/19/13
to google-ap...@googlegroups.com, bsr
From my experience I never saw gzipped content from dev server so I assume it is not supported (which is one of the inconsistencies why PageSpeed gives you different score).

On production environment gzip is supported but sometimes you receive gzipped response and sometimes you don't.
It is affected by the proxies between your location and appengine datacenter (when I load application from work I don't get compressed response while when I load it from home I does).

To consistently test response compression of your application on production env. you can use tool http://nontroppo.org/tools/gziptest/.

Hope it helps.
- Julius
Reply all
Reply to author
Forward
0 new messages