java - Wildfly 13 gzip 过滤器属性

标签 java jboss wildfly application-server

之前我使用的是 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的性能?

最佳答案

我做了研究并找到了解决方案。请在 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>

关于java - Wildfly 13 gzip 过滤器属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51630861/

相关文章:

java - 从 Solr 组件代码中获取 Zookeeper url 和 Solr 集合名称

java - Oauth2 身份验证后列出 Google 日历事件

java - Spring Batch 3.0.2 与 Spring Core 4.1.x 的集成 - 使用 @EnableBatchProcessing 的合适方法是什么?

java - 同步Web服务方法有意义吗?

deployment - JBOSS CLI 添加带有可选依赖项的模块

java - 一个应用程序可以窃取其他应用程序的数据库连接吗?

java - 我如何在 WildFly 8 中获得更多可用的密码套件

Java Wifi 多人游戏

java - Gradle WEB-INF/classes 文件夹

java - 我如何在 JBoss 中拥有多个具有相同 JNDI 名称的数据源?