JBoss EAP ,为HTML,CSS和javaScript文件启用GZIP压缩。
编辑:Standalone.xml
<subsystem xmlns="urn:jboss:domain:undertow:1.2"> <!-- SEARCH FOR THIS: urn:jboss:domain:undertow -->
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
(...)
<!-- ADD THIS FOR GZIP COMPRESSION -->
<filter-ref name="gzipFilter" predicate="exists['%{o,Content-Type}'] and regex[pattern='(?:application/javascript|text/css|text/html|text/xml|application/json)(;.*)?', value=%{o,Content-Type}, full-match=true]"/>
<!-- /GZIP COMPRESSION -->
</host>
</server>
(...)
<filters>
(...)
<!-- ADD THIS FOR GZIP COMPRESSION -->
<gzip name="gzipFilter"/>
<!-- /GZIP COMPRESSION -->
</filters>
</subsystem>
重新启动服务器