我刨使用哪種傳輸大量的跨network.I數據對我的應用程序omnifaces已經omnifaces配置web.xml文件提及展示如下gzip的設置與omnifaces
<filter>
<filter-name>gzipResponseFilter</filter-name>
<filter-class>org.omnifaces.filter.GzipResponseFilter</filter-class>
<init-param>
<description>
The threshold size in bytes. Must be a number between 0 and 9999. Defaults to 500.
</description>
<param-name>threshold</param-name>
<param-value>500</param-value>
</init-param>
<init-param>
<description>
The mimetypes which needs to be compressed. Must be a commaseparated string. Defaults to the below values.
</description>
<param-name>mimetypes</param-name>
<param-value>
text/plain, text/html, text/xml, text/css, text/javascript, text/csv, text/rtf,
application/xml, application/xhtml+xml, application/javascript, application/json
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>gzipResponseFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
蔭使用捲曲測試大小,但我沒有注意到任何顯着的差異。 沒有gzip的配置
curl http://localhost:8080/omnifaces-test/ > t
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1666 100 1666 0 0 126k 0 --:--:-- --:--:-- --:--:-- 147k
用gzip配置
curl http://localhost:8080/omnifaces-test/ > t
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1666 100 1666 0 0 283k 0 --:--:-- --:--:-- --:--:-- 406k
你能告訴我爲什麼我不是上面兩個命令得到什麼區別?
你的問題是什麼? – 2012-07-30 06:22:12
@LuiggiMendoza:爲什麼在啓用'GzipResponseFilter'後他沒有看到捲曲響應有任何不同。 – BalusC 2012-07-30 11:29:00
@LuiggiMendoza你沒有注意到我的問題:) – Suraj 2012-07-30 16:45:18