my $content = $cache->get($key);
unless ($content) {
process_request();
$cache->store($key, $content);
}
$content = $cache->get($key);
5 lines to get one value!! Ouch!!
I think we should have some thing on the lines of
$result = $cache->get(subroutine(),ttl=>5 );
The name 'subroutine()' itself should be stored as the key, and every time the ttl expires for the sub the subroutine should be called again to retrieve fresh information while updating the cache with latest value in the background.
]]>