我有一个在 tomcat 6 上运行的 jsf 应用程序(mojarra 2.1.8,primefaces 3.3)。在使用谷歌页面速度分析 firebug 页面时,我意识到我可以通过 gzip 压缩来优化一些东西。
Compressing the following resources with gzip could reduce their transfer size by 371,1KiB (74% reduction).
Compressing http://localhost:8080/someApp/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces could save 72,5KiB (74% reduction).
Compressing http://localhost:8080/someApp/javax.faces.resource/theme.css.jsf?ln=primefaces-aristo could save 53,4KiB (71% reduction).
Compressing http://localhost:8080/someApp/javax.faces.resource/jsf.js.jsf?ln=javax.faces could save 49,6KiB (78% reduction).
...
我已经在 server.xml 中打开了压缩
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"
compression="on"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/plain,application/javascript,application/json,text/javascript"/>
但它不会压缩上面列出的文件。
我还需要做什么才能使压缩工作?
强尼