Search code examples
javajbosswildflyapplication-server

Wildfly 13 gzip filter properties


Earlier I was using Jboss 7.1, where I have configured below properties for gzip filter, so that it improves my product performance. It was working fine.

<property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION" value="force"/>
<property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES" value="text/javascript,text/css,text/html"/>
<property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIN_SIZE" value="1000"/>

Now, I have recently migrated to Wildfly 13, where I think, this properties are not working. So, can you please help me with this?

Also, is there any other important configuration for improving wildfly performance?


Solution

  • I did research and found solution. Please search for undertow in standalone.xml and add filter related configuration changes as mentioned below :

    <subsystem xmlns="urn:jboss:domain:undertow:6.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other">
        <buffer-cache name="default"/>
        <server name="default-server">
            <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
            <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
            <host name="default-host" alias="localhost">
                <location name="/" handler="welcome-content"/>
                <filter-ref name="gzipFilter" predicate="not min-content-size[500] and regex[pattern='(?:application/javascript|text/css|text/html|text/xml|application/json)(;.*)?', value=%{o,Content-Type}, full-match=true]"/>
                <filter-ref name="server-header"/>
                <http-invoker security-realm="ApplicationRealm"/>
            </host>
        </server>
        <servlet-container name="default">
            <jsp-config/>
            <websockets/>
        </servlet-container>
        <handlers>
            <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
        </handlers>
        <filters>
            <response-header name="server-header" header-name="Server" header-value="Wildfly 13"/>
            <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow"/>
            <gzip name="gzipFilter"/>
        </filters>
    </subsystem>