NAME
Cache::DB_File - Memory cache which, when full, swaps to DB_File database.
SYNOPSIS
use Cache::DB_File ();
my $cache = Cache::DB_File->new(
max_size => 50, # Maximum elements in hash before swapping to disk.
expire => '1h 2m 1s', # Default expiry time for elements.
db_mode => 06400, # file mode for database.
highlow => '10m', # Time before a rarely accessed hit element in memory
# is moved to disk, or frequently accessed element in
# disk is moved to memory.
);
$cache->store('key', 'data');
$cache->store('key2', 'this data expires in 10 seconds', '10seconds');
my $in_cache = $cache->fetch('key');
$cache->sync(); # sync to disk.
$cache->close(); # NOTE: will also write elements in memory to disk.
ABSTRACT
Cache::DB_File is a cache system that has a optional limit on the number of elements,
and optional time limits on elements. When the memory cache reaches its limit,
it will swap infrequently used elements to disk.
DESCRIPTION
Cache::DB_File is a cache system that has a optional limit on the number of elements,
and optional time limits on elements. When the memory cache reaches its limit,
it will swap infrequently used elements to disk.
EXPORT
Cache::DB_File does not export anything.
SEE ALSO
perl, Cache::Cache, DB_File, Tie::Cache::LRU
AUTHOR
Ask Solem Hoel, <ask@unixmonks.net<gt>
COPYRIGHT AND LICENSE
Copyright 2002 by Ask Solem Hoel
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.