title: $ajax, loadin file json.gz from server without compresion enabled, how set headers?
body: <p>my first post here :)</p>
  
  <p>I got json file 'my_data.json'. It's about 3 MB. I  load this with:</p>
  
  <pre><code>$(document).ready(function() {
  $.ajax({
      'url' : 'my_data.json',
      dataType: 'json',
      success: function(json){
  </code></pre>
  
  <p>and everything is OK, script gets data from file and I can build a list from them. </p>
  
  <p>Because the size od the file I want to use compression, but my hosting provider has disabled mod_gzip and mod_deflate. So I compressed the file using PHP gzencode and now the file is 250kB only. New file is 'my_data.json.gz'.</p>
  
  <p>When I replace "my_data.json" with "my_data.json.gz" in previous code, nothing happends. I understand that I should inform the browser about the data are compressed. I read about headers and tried to add:</p>
  
  <pre><code>beforeSend: function (xhr){ 
          xhr.setRequestHeader("Content-Encoding","gzip");
      }, 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>headers: {"Content-Encoding": "gzip"},
  </code></pre>
  
  <p>after the line</p>
  
  <pre><code>dataType: 'json',
  </code></pre>
  
  <p>but nothing happends.</p>
  
  <p>What I'm doing wrong? In what file should I set and what?</p>
  
  <p>Please, point me into right direction.</p>