companieshouse / MojoX-Plugin-AnyCache

Mojolicious cache plugin
Other
0 stars 3 forks source link

Feature requests #2

Closed necrophonic closed 10 years ago

necrophonic commented 10 years ago

Need to be able to do:

Desirable

ian-kent commented 10 years ago

Done.

$cache->set('key', 'value', ttl);
$cache->set('key', 'value', ttl, sub { });

my $ttl = $cache->ttl('key');
$cache->ttl('key', sub { my $ttl = shift });

The ttl method returns the remaining TTL, not the original TTL.

It's emulated on Memcached backends - first need to set get_ttl_support, e.g.

$cache->backend->get_ttl_support(1);