title: mod_deflate with IBM WebSphere and IBM IHS
body: <p>I'm trying to enable response compression for css, js and html resources that are bundled as part of a Web application deployed to WebSphere v7. All HTTP traffic is routed to an IBM IHS HTTP server sitting in front of the WebSphere instance.</p>
  
  <p>I've created a <em>mod_deflate.conf</em> file and imported it into the <em>httpd.conf</em> file. Contents are as follows:</p>
  
  <pre><code>LoadModule deflate_module modules/mod_deflate.so
  
  DeflateCompressionLevel 3
  
  # Compress all content, manually excluding specified file types 
  &lt;IfModule mod_deflate.c&gt;   
      # place filter 'DEFLATE' on all outgoing content       
      SetOutputFilter DEFLATE   
      # exclude uncompressible content via file type   
      SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rar|zip)$ no-gzip   
      &lt;IfModule mod_headers.c&gt;
          # properly handle requests coming from behind proxies
          Header append Vary User-Agent   
      &lt;/IfModule&gt; 
  &lt;/IfModule&gt;
  
  # deflate.log, log compression ratio on each request 
  &lt;IfModule mod_deflate.c&gt;
      DeflateFilterNote Input instream
      DeflateFilterNote Output outstream
      DeflateFilterNote Ratio ratio
      LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
      CustomLog logs/deflate.log deflate
  &lt;/IfModule&gt;
  
  # Properly handle old browsers that do not support compression
  &lt;IfModule mod_deflate.c&gt;
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4\.0[678] no-gzip
      BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>When I view the HTTP traffic, I see that requests specify that gzip/deflate encoding is acceptable:</p>
  
  <pre><code>Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
  Accept-Encoding:"gzip, deflate" 
  </code></pre>
  
  <p>However, the responses are not being compressed (no headers are being returned relate to gzip/deflate):</p>
  
  <pre><code>Content-Type:"text/html; charset=UTF-8"
  Vary:"User-Agent"
  Server:"IBM_HTTP_Server"
  </code></pre>
  
  <p>Also, the deflate.log does not show any compression happening:</p>
  
  <pre><code>"GET /webapp/css/style.css HTTP/1.1" -/- (-%)
  "GET /webapp/js/jquery/jquery.ui.draggable.min.js HTTP/1.1" -/- (-%)
  "POST /webapp/markup/Basic.xhtml HTTP/1.1" -/- (-%)
  </code></pre>
  
  <p>The <strong>Vary</strong> response header is being sent back, so it's definitely hitting the configuration block where the SetOutputFilter is declared. </p>
  
  <p>What am I missing here -- isn't content compressed on-the-fly based on the filters/content type/resource name matches? In the above case, everything that doesn't match the regex <em>.(?:gif|jpe?g|png|rar|zip)$ no-gzip</em> should be compressed, no?</p>