Cache-CacheFactory
view release on metacpan or search on metacpan
Future development:
- documentation/cookbook for moving from Cache::Cache to Cache::CacheFactory.
- Cache::CacheFactory::Expiry::Base->set_purge_order().
- update_last_accessed_at option.
- weaken_refs option to combine with no_deep_clone?
- Other storage policies:
- Cache::BerkeleyDB
- requires BerkeleyDB.
- Expiry policies:
- 'all' pruning policy - just clears entire cache on purge().
- 'entries' pruning policy - prune if there's more than X keys.
- auto_purge options:
- Allow auto_purge on X set/get operations as well/instead of interval.
- get/load callback functions?
- refactor to complain about unhandled options to stop typo problems.
lib/Cache/CacheFactory/Object.pm view on Meta::CPAN
$self->set_key( $key );
# Produce a deep clone fo the data unless we don't need to
# or we're asked not to.
$data = Storable::dclone( $data )
if ref( $data ) and not $param->{ no_deep_clone };
# Set the data.
$self->set_data( $data );
# TODO: weaken ref param handling here?
# Overrule default properties if they've been supplied.
foreach my $property ( qw/created_at accessed_at expires_at/ )
{
if( exists( $param->{ $property } ) )
{
my ( $method );
$method = "set_${property}";
$self->$method( $param->{ $property } );
( run in 0.603 second using v1.01-cache-2.11-cpan-65fba6d93b7 )