Enable HTTP Compression (gzip)
Last modified by Eleni Cojocariu on 2026/08/13 13:17
Steps
To reduce the size of the HTTP responses XWiki sends to the browser, enable gzip compression in Tomcat:
- Open the TOMCAT_HOME/conf/server.xml file.
- Locate the <Connector> element used for HTTP traffic.
- 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" /> - Save the server.xml file.
- Restart the Apache Tomcat server.
- 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.