Apache-Cache
view release on metacpan or search on metacpan
# (via database, from file...)
$value = get_my_data('Key'); # here, the get_my_data() function is a function of your
# programe that generate a fresh value
# this data have to expires in 30 secondes
my $expires_in = '30 secondes';
$cache->set(Key => $value, $expires_in);
}
elsif($cache->status eq FAILURE)
{
# don't use cache, cache maybe busy by another child or something goes wrong
$value = get_my_data('Key');
}
DESCRIPTION
This module allows you to cache data easily through shared memory.
Whithin the framework of an apache/mod_perl use, this cache is
accessible from any child process. The data validity is managed in the
Cache::Cache model, but as well based on time than on size or number of
keys.
lib/Apache/Cache.pm view on Meta::CPAN
# (via database, from file...)
$value = get_my_data('Key'); # here, the get_my_data() function is a function of your
# programe that generate a fresh value
# this data have to expires in 30 secondes
my $expires_in = '30 secondes';
$cache->set(Key => $value, $expires_in);
}
elsif($cache->status eq FAILURE)
{
# don't use cache, cache maybe busy by another child or something goes wrong
$value = get_my_data('Key');
}
=head1 DESCRIPTION
This module allows you to cache data easily through shared memory. Whithin the framework
of an apache/mod_perl use, this cache is accessible from any child process. The data
validity is managed in the Cache::Cache model, but as well based on time than on size
or number of keys.
( run in 0.350 second using v1.01-cache-2.11-cpan-87723dcf8b7 )