简体   繁体   English

如何为JBoss配置Gzip?

[英]How to configure Gzip for JBoss?

I think to try to speed up my Web App by reducing the size of transferred data. 我认为尝试通过减少传输数据的大小来加快我的Web应用程序的速度。 For example, in Nginx there is a special module. 例如,在Nginx中有一个特殊的模块。 How to enable compression for JBoss server? 如何为JBoss服务器启用压缩?

JBoss AS version 6 or lower JBoss AS版本6或更低版本

To enable gzip compression, settings need to be added to your existing HTTP connector. 要启用gzip压缩,需要将设置添加到您现有的HTTP连接器中。
Located at /server/default/deploy/jbossweb.sar/server.xml : 位于/server/default/deploy/jbossweb.sar/server.xml

<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector protocol="HTTP/1.1" port="${jboss.web.http.port}"
        address="${jboss.bind.address}" redirectPort="${jboss.web.https.port}"

compression="force"
compressionMinSize="512"
noCompressionUserAgents=""
compressableMimeType="text/html,text/xml,text/css,text/javascript"
/>

JBoss AS 7.0.x JBoss AS 7.0.x

JBoss 7.0.x - 7.1.0 have no support for gzip compression build in . JBoss 7.0.x-7.1.0不支持内置的gzip压缩
See also issue report at: https://issues.jboss.org/browse/AS7-2991 另请参见问题报告: https//issues.jboss.org/browse/AS7-2991

One way to add gzip compression in JBoss 7.0 is to add is as filter. 在JBoss 7.0中添加gzip压缩的一种方法是添加作为过滤器。
For details: https://code.google.com/p/webutilities/wiki/CompressionFilter 有关详细信息: https : //code.google.com/p/webutilities/wiki/CompressionFilter

JBoss AS 7.1.1 JBoss AS 7.1.1

Just recently JBoss finished adding gzip compression to JBoss. 最近,JBoss完成了向JBoss添加gzip压缩的操作。 As of version 7.1.1Final, gzip compression is supported out of the box again. 从7.1.1Final版本开始,再次支持开箱即用的gzip压缩。 To enable, add to the server launch params: 要启用,请向服务器添加启动参数:

-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM