A static content compressor for maven web applications. It runs through your web application at build time and compresses some of the static content, creating a .gz file for each such resource.
This allows the browsers to download compressed content, which saves bandwidth and more importantly saves time for the user and improves the overall experience of the webapplication.
Some of webjars also have this enabled and your webjar-packaged libraries will be compressed as well.
- In jetty the support is built into the default servlet for quite some time and it is enalbled by default.
- In tomcat support for compressed content first appeared in 8.0 and not enabled by default, you have to enable it in order to use it!
<build>
<plugins>
<plugin>
<groupId>com.github.K0zka</groupId>
<artifactId>maven-contentgzip-plugin</artifactId>
<version>0.0.7</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals><goal>process</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The default configuration compresses the following file types:
- css
- txt
- htm,html
- js
- xml,xls
- ico
- doc