<filter>
<filter-name>CompressingFilter</filter-name>
<filter-class>com.planetj.servlet.filter.compression.CompressingFilter</filter-class>
<init-param>
<param-name>includeContentTypes</param-name>
<param-value>text/html,text/xml,text/plain,application/json</param-value>
</init-param>
<init-param>
<param-name>compressionThreshold</param-name>
<param-value>2048</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CompressingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
可以使得web传输的内容压缩传给浏览器
jar名字是pjl-comp-filter-1.7.jar
通过对比发现首页没有用filter,传输量是182k。使用后只有13k
<filter-name>CompressingFilter</filter-name>
<filter-class>com.planetj.servlet.filter.compression.CompressingFilter</filter-class>
<init-param>
<param-name>includeContentTypes</param-name>
<param-value>text/html,text/xml,text/plain,application/json</param-value>
</init-param>
<init-param>
<param-name>compressionThreshold</param-name>
<param-value>2048</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CompressingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
可以使得web传输的内容压缩传给浏览器
jar名字是pjl-comp-filter-1.7.jar
通过对比发现首页没有用filter,传输量是182k。使用后只有13k