Cache:...leCache(3pm)

πŸ’– Cache::SizeAwareFileCache πŸ’–

okay bestie, so this is Cache::SizeAwareFileCache β€” a Perl module, manual section 3pm, from the User Contributed Perl Documentation collection. and she extends Cache::FileCache. that's the whole vibe. let's go πŸ¦‹


✨ NAME ✨

Cache::SizeAwareFileCache β€” no cap, she extends Cache::FileCache. that's it, that's the name πŸ’…


🌸 DESCRIPTION 🌸

so the way that SizeAwareFileCache works?? she's a file-system-based cache, but she's self-aware about her own size. like, literally. this class adds the ability to dynamically limit the size, in bytes, of a file system based cache. obsessed 😭

she also implements the SizeAwareCache interface, which means she brings the 'max_size' option and the 'limit_size( $size )' method to the party. main character energy fr fr πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

here's how you summon her:

use Cache::SizeAwareFileCache;

my $cache =
  new Cache::SizeAwareFileCache( { 'namespace' => 'MyNamespace',
                                   'default_expires_in' => 600,
                                   'max_size' => 10000 } );

look at that constructor. she's got a 'namespace', a 'default_expires_in' of 600, and a 'max_size' of 10000. three little options and boom, you've got a size-aware cache. iconic ✨


πŸ’… METHODS πŸ’…

need the API deets? go check Cache::Cache and Cache::SizeAwareCache β€” that's where the documentation lives, bestie. i'm not gonna reinvent the wheel here 🫢


πŸ¦‹ OPTIONS πŸ¦‹

same deal, gorgeous. the standard options are all documented over in Cache::Cache and Cache::SizeAwareCache. run, don't walk πŸ’¨


🌈 PROPERTIES 🌈

and the default properties?? also in Cache::Cache and Cache::SizeAwareCache. she's consistent like that πŸ’œ


⭐ SEE ALSO ⭐

your reading list, in order:

  • Cache::Cache
  • Cache::SizeAwareCache
  • Cache::FileCache

go read them, i'll wait πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

  • Original author: DeWitt Clinton <dewitt@unto.net>
  • Also: Portions of this code are a rewrite of David Coppit's excellent extensions to the original File::Cache
  • Last author: $Author: dclinton $
  • Copyright (C) 2001-2003 DeWitt Clinton

shoutout to the authors, they ate and left no crumbs πŸ™ˆ


okay so that's the whole page, bestie. go build something cute with it πŸ’–

perl v5.34.0 Β· 2022-06-30 β€” and that's the version and date right there, no cap. catch you on the next manpage, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from