-
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
- sandip's blog
- Login or register to post comments
Comments
Django Compressor
http://code.google.com/p/minif y/
PHP Speedy
SmartOptimizer
There is an open source application that applies all clientside optimization actions for a PHP website - Web Optimizer, http://code.google.com/p/web-o ptimizator/