man > Cache::SizeAwareCache

πŸ“› NAME

Cache::SizeAwareCache – extends the Cache interface.

πŸš€ Quick Reference

Use CaseCommandDescription
πŸ“¦ Create a size-aware cache moduleuse parent qw(Cache::SizeAwareCache);Subclass the interface to build your own cache
πŸ“ Set maximum cache size$cache->set_max_size(1024);Enforce a hard byte limit (expensive on every set)
🧹 One‑time size reduction$cache->limit_size(512);Shrink cache to ≀ $new_size bytes now
♻️ Periodic size maintenance$cache->limit_size(8192);Recommended alternative to max_size – call in a cron/scheduler
∞ Disable size limit$cache->set_max_size($NO_MAX_SIZE);Default – no automatic size enforcement

πŸ“– DESCRIPTION

The SizeAwareCache interface is implemented by classes that support all of the Cache::Cache interface in addition to the limit_size and max_size features of a size aware cache.

The default cache size limiting algorithm works by removing cache objects in the following order until the desired limit is reached:

  1. βŒ› objects that have expired
  2. πŸ•’ objects that are least recently accessed
  3. πŸ“… objects that expire next

πŸ“œ SYNOPSIS

use Cache::SizeAwareCache;
use vars qw( @ISA );

@ISA = qw( Cache::SizeAwareCache );

πŸ”’ CONSTANTS

Please see Cache::Cache for standard constants

βš™οΈ METHODS

Please see Cache::Cache for the standard methods

πŸŽ›οΈ OPTIONS

Please see Cache::Cache for the standard options

πŸ“‹ PROPERTIES

Please see Cache::Cache for standard properties

πŸ”— SEE ALSO

Cache::Cache

✍️ AUTHOR

Original author: DeWitt Clinton <dewitt AT unto.net>

Last author: $Author: dclinton $

Copyright Β© 2001‑2003 DeWitt Clinton

Cache::SizeAwareCache
πŸ“› NAME πŸš€ Quick Reference πŸ“– DESCRIPTION πŸ“œ SYNOPSIS πŸ”’ CONSTANTS βš™οΈ METHODS πŸŽ›οΈ OPTIONS πŸ“‹ PROPERTIES πŸ”— SEE ALSO ✍️ AUTHOR

Generated by phpman v4.9.25-3-gdbaf087 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-06 21:36 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format