GZIP is not working for all files in Tomcat 7

Solution Verified - Updated -

Issue

Compression is working for most files, but there are files with Content-Type=application/javascript that are sent uncompressed. In the server.xml, compression is set to on:

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="10000"
               compression="on" 
               compressionMinSize="1024" 
               compressableMimeType="text/html,text/xml,text/css,text/javascript,application/javascript"
               redirectPort="8443" />

Environment

  • JBoss Web Server (EWS) 2.x
    • Tomcat 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content