How can I compress ALL my JavaScript files server-side with Apache? -
hey guys,
after running google page speed, compression results red. google page speed said files — js, css, etc. — should compressed gzip.
i added following line .htaccess file.
<ifmodule mod_deflate.c> addoutputfilterbytype deflate text/html text/css text/plain text/javascript text/xml application/xhtml+xml application/x-httpd-php </ifmodule>
now compression results slighly better - yellow! page speed keeps saying should compress all javascript libs , plugins. reduce them 65% gzip.
shouldn't js files compressed when have text/javascript
set deflate
?
apache uses mime type application/x-javascript, this howto explains how set it.
basically says need use:
<location /> addoutputfilterbytype deflate application/x-javascript </location>
on side note, might consider using minifier/compressor yui compressor or specific compressor integrates software.
Comments
Post a Comment