httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Millikan" <gmilli...@t1shopper.com>
Subject [users@httpd] Alternative to Apache htcacheclean for mod_disk_cache
Date Sat, 29 Oct 2011 19:20:48 GMT
We put this in our cron job to run once a day and it's working great.  

It deletes all files and directories which haven't been modified in 30 days.  We didn't use
access time "-atime" to determine which
files to delete because for performance reasons, we disabled atime on the file system.  A
disadvantage of this method is that it
doesn't keep cache size under a certain size (htcacheclean does).  It does have the advantage
of keeping the cached content fresh,
is much faster, and seems less resource intensive.  We found that our cache size is pretty
stable at about 2 to 4 GB (we average 8MM
hits/month) so we like this better.

root /usr/bin/find /var/httpd/proxy/* -type f -mtime +30 -exec rm -rf {} \;

Remember to change the "/var/httpd/proxy/*" directory to point to wherever your cache is.

Happy Web Serving,

Geoff Millikan
http://www.t1shopper.com/




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message