Cache::SizeAwareFileCache(3pm)
Cache::SizeAwareFileCache -- extends Cache::FileCache
| Use Case | Command | Description |
|---|---|---|
| Initialize cache with size limit | new Cache::SizeAwareFileCache( { 'max_size' => 10000 } ) |
Creates a new cache instance with a maximum size of 10KB. |
| Dynamically limit size | $cache->limit_size( $size ) |
Limits the cache size to the specified number of bytes. |
| Set context namespace | 'namespace' => 'MyNamespace' |
Sets the cache namespace to avoid collisions with other cache data. |
| Set default expiration | 'default_expires_in' => 600 |
Sets the default expiration time to 600 seconds. |
The SizeAwareFileCache class adds the ability to dynamically limit the size (in bytes) of a file system based cache. This class also implements the SizeAwareCache interface, providing the max_size option and the limit_size( $size ) method.
use Cache::SizeAwareFileCache;
my $cache =
new Cache::SizeAwareFileCache( { 'namespace' => 'MyNamespace',
'default_expires_in' => 600,
'max_size' => 10000 } );
See Cache::Cache and Cache::SizeAwareCache for the API documentation.
See Cache::Cache and Cache::SizeAwareCache for the standard options.
See Cache::Cache and Cache::SizeAwareCache for the default properties.
Original author: DeWitt Clinton dewitt AT 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
perl v5.20.2 2015-01-22 Cache::SizeAwareFileCache(3pm)
```Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 20:56 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)