Paolo Gabrielli\’s Blog

Just another near empty WordPress.com’s weblog. But this is from Paolo ‘pkirk’ Gabrielli.

Lighttpd css javascript js compress tip

Posted by paolo on 29 April, 2007

I don’t know why I haven’t thinked about it before, but with lighttpd it is possible in 30 seconds to manage sending the Java-Scripts and the CSSs compressed to the browsers, saving a lot of bandwidth against a little use of CPU.

I just added “mod_compress” to the list of modules in the array “server.modules” and
# {{{ mod_compress
compress.cache-dir = "/var/www/cache/"
compress.filetype = ("text/css", "text/javascript" )
#

in the /etc/lighttpd/lighttpd.conf file.  Obviously I created the directory /var/www/cache giving to it the permission needed by lighttpd to write there.

That’s it. And that’s only a little part of the unlimited powers of Lighttpd!

2 Responses to “Lighttpd css javascript js compress tip”

  1. eddie said

    Great idea, will have to try it out!

  2. Thanks!!! I was trying lighttpd on port 81 and apache on 80, but I couldn’t seem to get it to compress my javascripts, finally I noticed your mimetype for js was different than the one I had and I tried and it worked! Now I’m happily using lighttpd :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: