I have a web service that is willing to output gzip/deflated data. I\'ve verified that the service will respond with raw JSON or with gzip\'d JSON using wget and curl.
Browsers automatically add the accept-encoding header as appropriate, including on XHR requests. You don't need to do that at the DOM/JS level.