您建议使用哪种压缩(GZIP最受欢迎)servlet过滤器? [英] Which compression (is GZIP the most popular) servlet filter would you suggest?
问题描述
我正在寻找一个用于高容量网络应用程序的GZIP servlet过滤器。我不想使用特定于容器的选项。
I am looking for a GZIP servlet filter to be used in a high volume web-app. I doesn't want to use the container specific options.
要求
- 能够压缩响应有效负载(XML)
- 更快
- 在大批量应用的生产中得到验证
- 应该在容器中正确设置适当的内容编码
- 可选择解压缩请求
- Ability to compress response payload (XML)
- Faster
- Proven in production for high volume applications
- Should properly set appropriate Content-Encoding
- portable across containers
- Optionally able to decompress request
谢谢。
推荐答案
从我所看到的,大多数人一般都使用gzip压缩过滤器。通常来自 ehcache 。
From what i've seen, most people generally use the gzip compression filter. Typically from ehcache.
GZIP过滤器实现是:< a href =http://svn.terracotta.org/svn/ehcache/trunk/web/web/src/main/java/net/sf/ehcache/constructs/web/filter/GzipFilter.java\"rel =noreferrer > net.sf.ehcache.constructs.web.filter.GzipFilter
The GZIP filter implementation is: net.sf.ehcache.constructs.web.filter.GzipFilter
将其包含在项目中的Maven坐标是:
The Maven coordinate for including it in your project is:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-web</artifactId>
<version>2.0.4</version>
</dependency>
您还需要指定SLF4J记录目标。如果你不知道这是什么或不关心slf4j-jdk14或slf4j-simple工作:
You will also need to specify an SLF4J logging target. If you don't know what this is or don't care slf4j-jdk14 or slf4j-simple works:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.4</version>
</dependency>
这篇关于您建议使用哪种压缩(GZIP最受欢迎)servlet过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!