title: How to configure mod_gzip to exclude all but a few mime types?
body: <p>I need to configure a <code>.htaccess</code> file to enable compression of HTTP responses using <code>mod_gzip</code>. I can get the basic compression working.</p>
  
  <p>However, I want to <strong>disable</strong> compression for all MIME types, <em>except</em> for the following:</p>
  
  <ul>
  <li>text/*</li>
  <li>message/*</li>
  <li>application/x-javascript</li>
  <li>application/json</li>
  <li>application/atom+xml</li>
  <li>application/xaml+xml</li>
  </ul>
  
  <p>I know I can use statements such as <code>mod_gzip_item_exclude mime ^regex$</code> to include or exclude or exclude certain mime types, but I can't seem to get it quite right. How should I configure my <code>.htaccess</code> file?</p>