How to gzip CSS and Javascript files?


#1

hi everyone,
i noticed that my css and javascript files aren’t getting gzipped (giving me an F in yslow!). can anyone point me to a solution? is this something that can be enabled in the panel? i didn’t have any luck looking in google for how to do this in dreamhost.

thanks.


#2

Hi Rick,

You could try putting the following in a htaccess file in the site root:

mod_gzip_item_include file \.css$ mod_gzip_item_include file \.js$
Not sure if it works on Dreamhost as I don’t explicitly use it - my sites run fine as they are, and i tend to have a philosophy of “the less tinkering the better”.

Something I would advise possibly over gzipping css and javascript is “minfying”, to coin a YSlow phrase.

Cheers,
Karl

web design, development & seo by DigitalVibe