title: Apache mod_deflate not compressing json output
body: <p>I've followed all the steps in multiple tutorials to enable mod_deflate in Apache but I'm still not seeing compression (in Fiddler) when I issue requests for json (via PHP script) to my local web server. Compression isn't necessary for my browser to localhost but my machine will be periodically exposed over a slow VPN so I would like to use it.</p>
  
  <p>from httpd.conf:</p>
  
  <p><code>LoadModule deflate_module modules/mod_deflate.so</code> (not commented-out)</p>
  
  <p>mod_deflate.so exists in Apache2/modules</p>
  
  <p>PHP scripts immediately set the following header when run: <code>header('Content-Type: application/json');</code></p>
  
  <p><code>application/json</code> exists in Apache2/conf/mime.types</p>
  
  <p>And this is the relevant section from httpd.conf on the mime-types that should be compressed:</p>
  
  <pre><code>Alias /mapguide "C:/Program Files/OSGeo/MapGuide/Web/www/"
  &lt;Directory "C:/Program Files/OSGeo/MapGuide/Web/www/"&gt;
    AllowOverride All
    Options All -Indexes
    Order allow,deny
    Allow from all
  
  ...
  
    # Content compression
    AddType text/javascript js jgz
    AddOutputFilterByType DEFLATE text/javascript application/json text/html
  
    RewriteEngine on
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
  &lt;/Directory&gt;
  </code></pre>
  
  <p>When I issue a request to the server the request headers include <code>Accept-Encoding: gzip, deflate</code>, but the response comes back uncompressed. I have restarted Apache after every .conf change.</p>
  
  <p>Any suggestions very welcome!</p>