阿帕奇COM pression减缩的.js和.css文件不是COM pressed? [英] apache compression Deflate .js and .css files not compressed?

查看:111
本文介绍了阿帕奇COM pression减缩的.js和.css文件不是COM pressed?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apache的即时通讯通过添加以下到我的.htaccess文件使输出COM pression:

In Apache Im enabling output compression by adding the following to my .htaccess file:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<Files *.html>
SetOutputFilter DEFLATE
</Files>

所以我提供所有的内容与内容编码:gzip,但是当我测试我的网页与YSlow的我得到:

So I'm serving all content with Content-Encoding: gzip but when I test my webpage with Yslow I receive:

Grade D on Compress components with gzip

There are 3 plain text components that should be sent compressed

* http://mysite.com/javascript/youTubeEmbed/youTubeEmbed-jquery-1.0.css
* http://mysite.com/javascript/jquery.swfobject.1-1-1.min.js
* http://mysite.com/javascript/youTubeEmbed/youTubeEmbed-jquery-1.0.js

在哪里的问题?难道他们不应该得到COM $ P $自动pssed ??

Where's the problem?Shouldn't they get compressed automatically??

感谢

卢卡

推荐答案

你记得重新加载页面和运行YSlow的前清除缓存?

Did you remember to clear your cache before reloading the page and running Yslow?

我有完全相同的问题,并固定它这样。这是我的code:

I had the exact same problem and fixed it like that. This is my code:

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

这篇关于阿帕奇COM pression减缩的.js和.css文件不是COM pressed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆