我已经build立了Apache2服务gziped文件
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript application/json BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html DeflateCompressionLevel 9 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
当我在safari或chrome上testing文件,或者使用curl(curl -header'accept-encoding:gzip'url)来testing文件时,它完美地工作,但是它在IE7上似乎不起作用。
我使用http://www.webpagetest.org/进行testing。
难道我做错了什么 ?
谢谢
这将是问题。 您明确告诉它不要为MSIE(Microsoft Internet Explorer)浏览器进行gzip压缩。
“BrowserMatch bMSIE!no-gzip!gzip-only-text / html”
看起来你正在使用默认规则。 MSIE 5.5和6在使用gzip时遇到了问题,在这种情况下,修正是在服务于这些浏览器时不压缩内容。
下面的链接可以帮助你更好地理解它。
http://sebduggan.com/posts/ie6-gzip-bug-solved-using-isapi-rewrite
你可以很容易地解决这个问题。 取代你的比赛:
BrowserMatch \bMSIE\s7 !no-gzip !gzip-only-text/html
这将保持启用IE7和。