Javascript Tomcat7压缩JS/CSS

Javascript Tomcat7压缩JS/CSS,javascript,css,tomcat,tomcat7,http-compression,Javascript,Css,Tomcat,Tomcat7,Http Compression,我在tomcat7 server.xml中使用以下设置启用了压缩: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compre

我在tomcat7 server.xml中使用以下设置启用了压缩:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" 
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/json,text/javascript,text/css,text/plain,
application/javascript,application/xml,application/xml+xhtml"
/>

我已使用以下方法检查压缩是否已打开:

但是,PageSpeed仍然报告有几个CSS/JS文件没有被压缩。 例如
压缩可以节省109.5KB(减少84%)。

是否所有未压缩的CSS/JS文件都比较大?也许这些文件是通过“sendfile”发送的,因此可以避免被压缩

在文件中:

注意:在使用压缩(节省时间)和 带宽)和使用sendfile功能(节省CPU周期)。如果 连接器支持sendfile功能,例如NIO连接器, 使用sendfile将优先于压缩 将发送大于48 Kb的静态文件 未压缩。您可以通过设置useSendfile关闭sendfile 属性,或更改 中DefaultServlet配置中的sendfile使用阈值 默认的conf/web.xml或web应用程序的web.xml。”

在配置中设置:

useSendfile="false"

不,我也有小文件的问题。不管怎样,我已经添加了这一行,并设置了compression=“force”,但我仍然遇到同样的问题。有什么解决方案吗?我也有同样的问题。我最终使用了带有pagespeed模块的Apache HTTPD:)我需要一个使用Tomcat的解决方案。。。