Cache::AgainstFile::Base - base class for default backends
package Cache::AgainstFile::MyBackend; use Cache::AgainstFile::Base; @ISA = qw(Cache::AgainstFile::Base); ...implement methods... 1;
This provides a default implementation for purging the cache, based on a list of stale files and a hashref of access times.
Classes inheriting from this base class should provide the following public methods:
This should call the base class constructor.
Fetch an item from the cache. @opts should be passed after the filename to the loader coderef.
Number of items in the cache
Total size of the cache in bytes
They should also provide the following protected methods which are used to support purge():
Remove a number of items from the cache
A hashref of filename => access time
A list of cache items which are stale with respect to their original files
The implementation of purge() supports the options:
$Revision: 1.8 $ on $Date: 2005/06/03 14:29:55 $ by $Author: johna $
John Alden <cpan _at_ bbc _dot_ co _dot_ uk>
(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL.
See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt
To install Cache::AgainstFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cache::AgainstFile
CPAN shell
perl -MCPAN -e shell install Cache::AgainstFile
For more information on module installation, please visit the detailed CPAN module installation guide.