[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    [users@httpd] Alternative to Apache htcacheclean for mod_disk_cache
From:       "Geoff Millikan" <gmillikan () t1shopper ! com>
Date:       2011-10-29 19:20:48
Message-ID: 08c601cc966f$ddf4b580$99de2080$ () t1shopper ! com
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic