Cache::CacheFactory::Expiry::Time - Time-based expiry policy for Cache::CacheFactory.
Cache::CacheFactory::Expiry::Time is a time-based expiry (pruning and validity) policy for Cache::CacheFactory.
It provides similar functionality and backwards-compatibility with the $expires_in and $default_expires_in properties of Cache::Cache.
$expires_in
$default_expires_in
You can use any of the syntaxes provided by Cache::Cache to specify an interval for expiry times, for example:
$Cache::Cache::EXPIRES_NEVER $Cache::Cache::EXPIRES_NOW '4 seconds' '1 m' 'now' 'never'
For a full list take a look at the set() section of the Cache::Cache documentation.
set()
The following startup options may be supplied to Cache::CacheFactory::Expiry::Time, see the Cache::CacheFactory documentation for how to pass options to a policy.
For a pruning policy this sets the default interval after which an item becomes eligible to be pruned.
For a validity policy this sets the default time interval after which an item should be considered invalid.
This option provides backwards-compatibility with Cache::Cache, it sets default_prune_after for pruning policies and default_valid_until for validity policies.
default_prune_after
default_valid_until
The following options may be set when storing a key, see the Cache::CacheFactory documentation for details on how to do this.
For a pruning policy this sets the interval after which the item becomes eligible to be pruned. If not supplied then the value of default_prune_after in the startup options will be used.
For a validity policy this sets the time interval after which the item should be considered invalid. If not supplied then the value of default_valid_until in the startup options will be used.
This option provides backwards-compatibility with Cache::Cache, it behaves as prune_after for pruning policies and valid_until for validity policies.
prune_after
valid_until
You should generally call these via the Cache::CacheFactory interface rather than directly.
Set or get the default_expires_in option.
default_expires_in
Cache::CacheFactory, Cache::Cache, Cache::CacheFactory::Object, Cache::CacheFactory::Expiry::Base
Original author: Sam Graham <libcache-cachefactory-perl BLAHBLAH illusori.co.uk>
Last author: $Author: illusori $
Copyright 2008-2010 Sam Graham.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Cache::CacheFactory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cache::CacheFactory
CPAN shell
perl -MCPAN -e shell install Cache::CacheFactory
For more information on module installation, please visit the detailed CPAN module installation guide.