Enable HTTP Compression (gzip)

Last modified by Eleni Cojocariu on 2026/08/13 13:17

Content

Steps

To reduce the size of the HTTP responses XWiki sends to the browser, enable gzip compression in Tomcat:

  1. Open the TOMCAT_HOME/conf/server.xml file.
  2. Locate the <Connector> element used for HTTP traffic.
  3. Add or update the following attributes inside the Connector:
    <Connector port="8080"
    ...
    compression="on"
    compressionMinSize="2048"
    compressibleMimeType="text/html,text/xml,text/css,text/javascript,application/json" />
  4. Save the server.xml file.
  5. Restart the Apache Tomcat server.
  6. Open your wiki in a browser and check the "Network" tab of the browser developer tools. The responses served by XWiki now carry a Content-Encoding: gzip header.

FAQ

Which responses are compressed?

Only the MIME types listed in compressibleMimeType, and only responses larger than compressionMinSize bytes. Images and other already-compressed formats are not worth adding.

Get Connected