Tom Copeland
2/15/2007 3:40:00 PM
On Thu, 2007-02-15 at 20:40 +0900, Daniel DeLorme wrote:
> Chris Gallagher wrote:
> > Does anyone know of any script that can be used to compress css for
> > deployment. Im looking for something that can be used during the build
> > process rather than something you click to acheive it. Were currently
> > using jsmin for javascript, something like that for css would be ideal.
>
> gzip
>
> Seriously, most browsers accept gzip compression so if you want to save
> bandwidth, the best option is to have a .gz version of each css file and
> send that if the browser supports gzip encoding. This is what I do for
> my css and javascript files:
> ReWriteCond %{HTTP:accept-encoding} gzip
> RewriteCond %{DOCUMENT_ROOT}$1.gz -f
> RewriteRule ^(.+)$ $1.gz [passthrough,last]
Or you can use mod_deflate; then you don't need to provide a gzip'd
version. Of course, that will cost some server CPU time, so it's a
tradeoff...
Yours,
Tom