mod_deflate for css and js

半腔热情 提交于 2019-12-25 08:02:13

问题


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)

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.


回答1:


Ok I don't know how, this finally worked and the css became 2KB instead of 6KB. Thanks everybody for your help.



来源:https://stackoverflow.com/questions/3896976/mod-deflate-for-css-and-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!