【问题标题】:Wildfly 13 gzip filter propertiesWildfly 13 gzip 过滤器属性
【发布时间】:2019-01-08 21:09:59
【问题描述】:

之前我使用的是 Jboss 7.1,我在其中为 gzip 过滤器配置了以下属性,以便提高我的产品性能。它工作正常。

<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"/>

现在,我最近迁移到 Wildfly 13,我认为这个属性不起作用。那么,你能帮我解决这个问题吗?

另外,还有其他重要的配置可以提高 Wildfly 的性能吗?

【问题讨论】:

    标签: java jboss wildfly application-server


    【解决方案1】:

    WildFly 13 使用 Undertow 作为其 Web 容器,而不是 JbossWeb/Apache Tomcat,因此那些属于 Tomcat 的过滤器不可用。 请看Configuration GZip at Wildfly

    【讨论】:

      【解决方案2】:

      我进行了研究并找到了解决方案。请在standalone.xml搜索undertow并添加过滤器相关的配置更改,如下所述:

      <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>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-01-14
        • 1970-01-01
        • 1970-01-01
        • 2014-05-30
        • 1970-01-01
        相关资源
        最近更新 更多