Lighttpd client side optimization
Wed, 09/02/2009 - 12:06 — sandip-
Edit conf file: /etc/lighttpd/lighttpd.conf
Enable mod_expire and mod_compress.
Expire static files set for 3 days:
$HTTP["url"] =~ "\.(js|css|gif|jpg|png|ic o|txt|swf|html|htm)$" { expire.url = ( "" => "access 3 days" ) }
compress.cache-dir = "/var/cache/lighttpd/comp ress/"
compress.filetype   ;   ; = ("text/plain", "text/html", "text/css", "text/xml", "text/javascript")
#!/bin/bash
# lighttpd_cache_clean
# Clean cache stored at /var/cache/lighttpd/compressr /># Place in /etc/cron.daily
# Cache dir path
CROOT="/var/cache/light tpd/compress"
#Deleting files older than 3 days
HOURS=72
# Lighttpd user and group
LUSER="lighttpd"r />LGROUP="lighttpd"< br />
# start cleaning
/usr/sbin/tmpwatch --mtime ${HOURS} ${CROOT}
# if directory missing just recreate it
if [ ! -d $CROOT ]
then
&nbs p; mkdir -p $CROOT
&nbs p; chown ${LUSER}:${LGROUP} ${CROOT}
fi
exit 0
mkdir -p /var/cache/lighttpd/compressr />chown lighttpd:lighttpd /var/cache/lighttpd/compress