Gzipping Css And Js Files
Solution 1:
Do you have AddType lines for .css and .js? It's pretty hard for Apache to automatically figure out the types by content alone -- they both look a lot like C code.
Try adding these lines to your .htaccess...
AddType text/css .css
AddType application/x-javascript .js
Solution 2:
Added, and it didn't help
Works for me, I'm now getting Content-Type: text/css
and gzip
encoding, which wasn't happening before due to the missing type mappings. That's something that should really be fixed server-wide though; it is a very broken server that cannot serve stylesheets and scripts with the right type.
Incidentally you should use text/javascript
for scripts, for proper browser compatibility. application/javascript
is proposed as ‘better’ for various nitpicking technical reasons, but it doesn't have the support so you can ignore that. x-javascript
is long gone.
Post a Comment for "Gzipping Css And Js Files"