Cache:...taData(3pm)
π NAME π
Cache::CacheMetaData β literally all the tea about what's chillin' in your cache π«β¨
πΈ DESCRIPTION πΈ
okay so bestie, picture this: size aware caches need someone keeping receipts on the state of the cache, right? That's exactly what the CacheMetaData object does. It's the friend who remembers everything so you don't have to β it can hand you info like an object's size, or a whole ordered list of identifiers that need to get yeeted when a cache size is being limited. π
ngl though, if you're just an end user, you will not normally use CacheMetaData directly. It's giving behind-the-scenes main character. The caches handle it. You just vibe. π
β¨ SYNOPSIS β¨
use Cache::CacheMetaData;
my $cache_meta_data = new Cache::CacheMetaData( );
foreach my $key ( $cache->get_keys( ) )
{
my $object = $cache->get_object( $key ) or
next;
$cache_meta_data->insert( $object );
}
my $current_size = $cache_meta_data->get_cache_size( );
my @removal_list = $cache_meta_data->build_removal_list( );
like... look at her go π¦
π METHODS π
new( )β construct a brand newCache::CacheMetaDataobject. fresh out the box, no notes. β¨insert( $object )β slide the CacheMetaData the info it needs about$object, the object sitting in the cache. keep her in the loop bestie. π«Άremove( $key )β tell the CacheMetaData that the object specified by$keyis no longer in the cache. gone, bye, she's not coming back. πbuild_removal_list( )β build a list of the keys in the cache, ordered like this:- objects that expire now π
- objects expiring at a particular time, with ties broken by the time at which they were least recently accessed
- objects that never expire, sub ordered by the time at which they were least recently accessed
NOTE: this could be improved further by taking the size into account on accessed_at ties. However, this type of tie is unlikely in normal usage. so basically it's a "sure bestie, noted, but it's not gonna come up" situation π
build_object_size( $key )β return the size of an object specified by$key. boom, measurements. π
π PROPERTIES π
get_cache_sizeβ the total size of the objects in the cache. the whole squad combined. β
π SEE ALSO π
Cache::Cache, Cache::CacheSizer, Cache::SizeAwareCache
π AUTHOR π
- Original author: DeWitt Clinton
<dewitt@unto.net> - Last author:
$Author: dclinton $ - Copyright (C) 2001-2003 DeWitt Clinton
and that's the whole page, bestie π₯° this little legend came to you courtesy of perl v5.34.0, dated 2022-06-30 β no cap, that's the version and the date right there in the footer, and yes it's iconic, periodt. πππ¦
π¦ where this page comes from
- debian bookworm: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- debian trixie: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu noble: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu resolute: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu stonking: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms