Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Struts2 GZIP压缩到Tomcat7,但我的页面大小仍然相同_Struts2_Gzip_Http Compression - Fatal编程技术网

Struts2 GZIP压缩到Tomcat7,但我的页面大小仍然相同

Struts2 GZIP压缩到Tomcat7,但我的页面大小仍然相同,struts2,gzip,http-compression,Struts2,Gzip,Http Compression,我的网页上有很多图片来自Tomcat7的server.xml中配置的文件系统 现在我尝试在Tomcat7中使用gzip,但页面大小仍然没有减少,特别是我的图像大小相同。我使用的是struts2,对于压缩,我在server.xml文件中使用了以下代码 <Connector connectionTimeout="20000" maxPostSize="67589953" port="9090" protocol="HTTP/1.1" redirectPort="8443" compressio

我的网页上有很多图片来自Tomcat7的server.xml中配置的文件系统

现在我尝试在Tomcat7中使用gzip,但页面大小仍然没有减少,特别是我的图像大小相同。我使用的是struts2,对于压缩,我在server.xml文件中使用了以下代码

<Connector connectionTimeout="20000" maxPostSize="67589953" port="9090" protocol="HTTP/1.1" redirectPort="8443" compression="force" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compressableMimeType="image/jpeg"  />


您阅读了吗?感谢roman的帮助,我只想确认我使用的方式是正确的,或者可以在这里做一些改进。OT:您的网页大小是22米吗?!如果图像是静态的,您可以压缩文件,而不是将tomcat配置为对每个请求中的每个图像进行压缩。您阅读了吗?感谢roman的帮助,我只想确认我使用的方式是正确的,或者可以在此处进行一些改进。OT:您的网页大小是22M吗?!如果图像是静态的,您可以压缩文件,而不是配置tomcat对每个请求中的每个图像进行压缩。