title: No auto-decompression of gzipped json on browser's side when using angular's http get method
body: <p>I'm trying to load a json file using angular (v1.2.6):</p>
  
  <pre><code>$http.get('myfile.json').success(function(data) { ... }
  </code></pre>
  
  <p>This works fine, except when I create a (static) compressed version of the file on the server, and try to load 'myfile.json.gz' instead (to reduce the loading time).</p>
  
  <p>The request headers seem correct (Chrome 31.0 on Mac) (as stated <a href="https://stackoverflow.com/questions/18390343/can-you-gunzip-the-contents-of-a-get-request-in-angular">here</a> and <a href="https://stackoverflow.com/a/8350800/1673408">here</a>):</p>
  
  <pre><code>Accept: application/json, text/plain, */*
  Accept-Encoding: gzip,deflate,sdch
  </code></pre>
  
  <p>while the response headers contain:</p>
  
  <pre><code>Connection: close
  Accept-Ranges: bytes
  Content-Length: 702468
  Content-Type: application/x-gzip
  Content-Encoding: gzip
  </code></pre>
  
  <p>However, the content is not automatically decompressed by the client browser, as I understand <a href="https://stackoverflow.com/questions/17556275/native-gzip-decompression-in-chrome-in-javascript">it should be</a>. <code>data.length</code> is ~700Kb instead of the original uncompressed ~3Mb.</p>
  
  <p>Although this one <a href="https://groups.google.com/forum/#!topic/angular/HrDrzifKKQg" rel="nofollow noreferrer">post</a> suggests it needs to be done manually, I understand decompression should be automatic and transparent.</p>
  
  <p>My question is, should it be decompressed automatically? and why isn't it the case here?</p>