Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.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
Performance tomcat7中的GZip压缩在IE9中不起作用_Performance_Internet Explorer_Tomcat_Tomcat7_Gzip - Fatal编程技术网

Performance tomcat7中的GZip压缩在IE9中不起作用

Performance tomcat7中的GZip压缩在IE9中不起作用,performance,internet-explorer,tomcat,tomcat7,gzip,Performance,Internet Explorer,Tomcat,Tomcat7,Gzip,我在server.xml文件中使用以下代码。它在firefox中运行良好,响应大小大大减小。200kb->25kb。但是,不是在IE9工作。如有任何帮助或建议,将不胜感激 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" maxHttpHeaderSize="8192" maxThreads="150" minSpareThr

我在server.xml文件中使用以下代码。它在firefox中运行良好,响应大小大大减小。200kb->25kb。但是,不是在IE9工作。如有任何帮助或建议,将不胜感激

 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"
       maxHttpHeaderSize="8192"
           maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
           enableLookups="false" acceptCount="100"
           disableUploadTimeout="true" 
           compression="on" compressionMinSize="2048" 
     noCompressionUserAgents="gozilla, traviata" 
     compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,text/json,application/x-javascript,application/javascript,application/json"    
/>

只有在用户代理希望压缩时才会进行压缩

当用户代理发出请求时,它需要通过Accept Encoding标头发送其compress首选项

accept-encoding:gzip,deflate,sdch
只有当此标头作为web请求的一部分发送时,web服务器才会对发送的内容启用压缩。您可以使用curl来测试它

curl -L http://localhost/index.jsp -H 'Accept-Encoding: gzip' -o - | gzip
上面将生成一个压缩数据,可以使用gzip解压


大多数情况下,IE似乎不喜欢将页面内容压缩,也不确定为什么会发生这种情况。

看看IE使用以下工具发送的HTTP头:ieHTTPHeaders@MarkThomas-当我在IE中使用IE dev工具栏查看请求头时,在接受编码中,它显示为gzip,hi kannan,当我在IE中查看请求头时,在接受编码中,它显示为gzip,deflate。但是,在响应部分,gzip没有在firefox中启用,你能粘贴IE的完整请求和响应头吗。