Apache::AxKit::CacheCleaner version 0.90
========================================

NAME

Apache::AxKit::CacheCleaner - delete old files from AxKit's cache directory

SYNOPSIS

Method 1: run it from a cron job (recommended method):

    axkit-cache-cleaner --max-age="1 month" --cache-dir=/var/cache/axkit

Method 2: configure it as an Apache cleanup handler in httpd.conf:

    AxCacheDir /var/cache/axkit
    PerlCleanupHandler +Apache::AxKit::CacheCleaner
    PerlSetVar AxCacheCleanerFrequency "1 day"
    PerlSetVar AxCacheCleanerMaxAge    "1 month"

To enable file locking (for either method):

    AxCacheModule +Apache::AxKit::CacheCleaner

You also need to patch AxKit's cache module to enable file locking.

DESCRIPTION

This module searches AxKit's cache directory and deletes files whose
last access time is older than a specific maximum age.  For example,
you could run it nightly in a cron job and instruct it to delete files
older than one month.  Alternatively, you can configure it to run
periodically during Apache's cleanup phase.

File locking can be enabled so that a file is not deleted from the
cache when it is about to be used again to serve a request.  This
locking avoids the browser displaying a "404 Not Found" error message.

INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

PATCHING AXKIT

It is necessary to patch AxKit to allow this module to override the
initialization of the cache so that locks can be obtained before cache
subdirectories are created.  See the Perl pod documentation in
Apache::AxKit::CacheCleaner for more information on whether you really
need to do this.

The included patch can be applied to versions 1.6.X and 1.7.0 of
AxKit.  Here is an example of applying the patch:

  patch --backup /usr/local/lib/site_perl/Apache/AxKit/Cache.pm \
    patch/Cache.patch

DEPENDENCIES

This module requires these other modules and libraries:

  AxKit 1.6.1 (tested with version 1.6.2)

COPYRIGHT AND LICENSE

Copyright (c) 2006 Ken Neighbors.  All rights reserved.  This module
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
