1Cache::SizeAwareCache(3U)ser Contributed Perl DocumentatiCoanche::SizeAwareCache(3)
2
3
4
6 Cache::SizeAwareCache -- extends the Cache interface.
7
9 The SizeAwareCache interface is implemented by classes that support all
10 of the Cache::Cache interface in addition to the limit_size and
11 max_size features of a size aware cache.
12
13 The default cache size limiting algorithm works by removing cache
14 objects in the following order until the desired limit is reached:
15
16 1) objects that have expired
17 2) objects that are least recently accessed
18 3) objects that expire next
19
21 use Cache::SizeAwareCache;
22 use vars qw( @ISA );
23
24 @ISA = qw( Cache::SizeAwareCache );
25
27 Please see Cache::Cache for standard constants
28
29 $NO_MAX_SIZE
30 The cache has no size restrictions
31
33 Please see Cache::Cache for the standard methods
34
35 limit_size( $new_size )
36 Attempt to resize the cache such that the total disk usage is under
37 the $new_size parameter. $new_size represents t size (in bytes)
38 that the cache should be limited to. Note that this is only a one
39 time adjustment. To maintain the cache size, consider using the
40 max_size option, although it is considered very expensive, and can
41 often be better achieved by periodically calling limit_size.
42
44 Please see Cache::Cache for the standard options
45
46 max_size
47 Sets the max_size property (size in bytes), which is described in
48 detail below. Defaults to $NO_MAX_SIZE.
49
51 Please see Cache::Cache for standard properties
52
53 (get|set)_max_size
54 If this property is set, then the cache will try not to exceed the
55 max size value (in bytes) specified. NOTE: This causes the size of
56 the cache to be checked on every set, and can be considered *very*
57 expensive in some implementations. A good alternative approach is
58 leave max_size as $NO_MAX_SIZE and to periodically limit the size
59 of the cache by calling the limit_size( $size ) method.
60
62 Cache::Cache
63
65 Original author: DeWitt Clinton <dewitt@unto.net>
66
67 Last author: $Author: dclinton $
68
69 Copyright (C) 2001-2003 DeWitt Clinton
70
71
72
73perl v5.36.0 2022-07-22 Cache::SizeAwareCache(3)