Skip to content

Instantly share code, notes, and snippets.

@uuklanger
Created February 1, 2018 20:21
Show Gist options
  • Save uuklanger/12f66877780779cae24fe140aa84bc1a to your computer and use it in GitHub Desktop.
Save uuklanger/12f66877780779cae24fe140aa84bc1a to your computer and use it in GitHub Desktop.
Turn On Tomcat Compression
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
compression="on"
compressionMinSize="1024"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"/>
@uuklanger
Copy link
Author

<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />

--- CHANGE ABOVE TO ---

<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 8080

<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />
-->

<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443"
           compression="on" 
       compressionMinSize="1024" 
       compressableMimeType="text/html,text/xml,text/plain"/>			   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment