您建议使用哪种压缩(GZIP最受欢迎)servlet过滤器? [英] Which compression (is GZIP the most popular) servlet filter would you suggest?

查看:93
本文介绍了您建议使用哪种压缩(GZIP最受欢迎)servlet过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个用于高容量网络应用程序的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.

要求


  1. 能够压缩响应有效负载(XML)

  2. 更快

  3. 在大批量应用的生产中得到验证

  4. 应该在容器中正确设置适当的内容编码


  5. 可选择解压缩请求

  1. Ability to compress response payload (XML)
  2. Faster
  3. Proven in production for high volume applications
  4. Should properly set appropriate Content-Encoding
  5. portable across containers
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆