适用于CSS和JS的mod_deflate [英] mod_deflate for css and js
本文介绍了适用于CSS和JS的mod_deflate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用mod_deflate压缩我的网页,但是我看到只有HTML被压缩,而CSS没有压缩.
I'm using mod_deflate to compress my web pages but I see that only the HTML is compressed no compression for the css.
Documents (1 file) 4 KB (18 KB uncompressed)
http://localhost/web/ 4 KB (18 KB uncompressed)
Images (16 files) 96 KB
Objects (0 files)
Scripts (2 files) 26 KB (73 KB uncompressed)
http://code.jquery.com/jquery-1.4.2.min.js 24 KB (70 KB uncompressed)
http://localhost/web/js.js 2 KB
Style Sheets (1 file) 6 KB
http://localhost/web/css/style.css 6 KB
Total 132 KB (192 KB uncompressed)
我的.htaccess如下:
My .htaccess looks like:
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
有什么建议吗? 预先感谢.
Any suggestions? Thanks in advance.
推荐答案
好吧,我不知道怎么做,这终于奏效了,css变成了2KB而不是6KB. 谢谢大家的帮助.
Ok I don't know how, this finally worked and the css became 2KB instead of 6KB. Thanks everybody for your help.
这篇关于适用于CSS和JS的mod_deflate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文