title: Tomcat 8.5.29 HTTP/2 is not supporting GZIP compression
body: <p>I am using Tomcat 8.5.29 and using the respective configuration,I have enabled the HTTP2 support for the site. Below is the configuration in server.xml file.</p>
  
  <pre><code>&lt;Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol"
             maxThreads="150" SSLEnabled="true" compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json" compression="on" compressionMinSize="1024"
             &gt;
      &lt;UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /&gt;
      &lt;SSLHostConfig&gt;
          &lt;Certificate certificateKeyFile="conf/localhost-key.pem"
                       certificateFile="conf/localhost-cert.pem"
                       certificateChainFile="conf/cacert.pem"
                       type="RSA" /&gt;
      &lt;/SSLHostConfig&gt;
  &lt;/Connector&gt;
  </code></pre>
  
  <p>When i tried to compare the page load time for the site which is supporting HTTPS 1.1 and HTTP2, it is not consistent. Sometime it is taking more time to load and sometime it is taking less time to load compare to HTTPS 1.1.</p>
  
  <p>To measure the page load time i am using Developer tools from Chrome Browser.</p>
  
  <p>Later, I have found that Load time for HTTP/2 is higher because "content-encoding" in response is not gzip. Using HTTP/1.1, a script file size is 4 MB ( gzip) where as with HTTP/2, same file is of 8 MB ( no content-encoding). Compression is not happening. We have also tried with useSendfile and compression as "force" but it did not work.</p>
  
  <p>We have also tried with Tomcat version 8.5.31 but no luck !! Facing same issue.</p>
  
  <p>We have used Tomcat version 9 and using following configuration, got content in gzip (compressed). Now file size got reduced by 2 MB with a quick page load.</p>
  
  <pre><code>&lt;Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol"
             maxThreads="150" SSLEnabled="true" 
             &gt;
      &lt;UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json" compression="on" compressionMinSize="1024" /&gt;
      &lt;SSLHostConfig&gt;
          &lt;Certificate certificateKeyFile="conf/localhost-key.pem"
                       certificateFile="conf/localhost-cert.pem"
                       certificateChainFile="conf/cacert.pem"
                       type="RSA" /&gt;
      &lt;/SSLHostConfig&gt;
  &lt;/Connector&gt;
  </code></pre>
  
  <p>It looks like Tomcat version 8.5 is not supporting gzip with HTTP2. Any idea on this?</p>