Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
222 views
in Technique[技术] by (71.8m points)

javascript - mod_deflate for css and js

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...