YSlow 告诉我网站没有压缩,即使它是
“使用 gzip 压缩组件的等级为 F
有 19 个纯文本组件应该被压缩发送”
我已经检查了主页的压缩情况,以及使用“http://www.whatsmyip.org/http_compression/" 并且它显示了所有压缩。此外,我确保我没有使用代理,并且“Accepting-Encoding”是 gzip/deflate 使用“ http://www.lagado.com/proxy-test”。与这些结果相反,mod_deflate 日志文件如下(摘录):
...“GET / HTTP/1.1”4498/13306 (33%) “获取/Home_Page/style.css HTTP/1.1” -/- (-%) "GET /css/style.css HTTP/1.1" -/- (-%) "GET /css/slimbox.css HTTP/1.1" -/- (-%) "GET /js/validator_o.js HTTP/1.1" -/- (-%) ...
所以它没有压缩css或js文件?我的配置文件如下:
<IfModule mod_deflate.c> SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript text/xml image/svg+xml application/javascript application/x-javascript application/atom_xml application/rss+xml application/xml application/xhtml+xml application/x-httpd-php application/x-httpd-fastphp
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog /etc/httpd/logs/deflate_log deflate </IfModule>
Firefox 3.6.8 Windows 7 专业版 ISP:罗杰斯
"Grade F on Compress components with gzip
There are 19 plain text components that should be sent compressed"
I have checked the compression of the main page, as well as all 19 components individually using "http://www.whatsmyip.org/http_compression/" and it shows compression in all of them. Furthermore, I ensured I'm not using a proxy and that "Accepting-Encoding" is gzip/deflate using "http://www.lagado.com/proxy-test". Contrary to these results, the mod_deflate log files is as follows (excerpt):
... "GET / HTTP/1.1" 4498/13306 (33%)
"GET /Home_Page/style.css HTTP/1.1"
-/- (-%) "GET /css/style.css HTTP/1.1" -/- (-%) "GET /css/slimbox.css HTTP/1.1" -/- (-%) "GET
/js/validator_o.js HTTP/1.1" -/- (-%)
...
So it's not compressing the css or js files? My config file is as follows:
<IfModule mod_deflate.c> SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript text/xml image/svg+xml application/javascript application/x-javascript application/atom_xml application/rss+xml application/xml application/xhtml+xml application/x-httpd-php application/x-httpd-fastphp
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog /etc/httpd/logs/deflate_log deflate </IfModule>
Firefox 3.6.8
Windows 7 Professional
ISP: Rogers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系,现在它起作用了。我按如下方式设置修改后的配置文件,
然后重新加载浏览器缓存并检查日志文件,它已被压缩。伊斯洛同意了。
Nevermind, it worked now. I set the modified the config file as follows
Then did a browser cache reload and checked the log files and it was compressed. Yslow agreed.