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

查看:19
本文介绍了您建议使用哪种压缩(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. 应该正确设置适当的Content-Encoding
  5. 可跨容器移植
  6. 可选择解压请求

谢谢.

推荐答案

据我所知,大多数人通常使用 gzip 压缩过滤器.通常来自 ehcache.

From what i've seen, most people generally use the gzip compression filter. Typically from ehcache.

GZIP 过滤器实现是: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天全站免登陆