{
    "mode": "perldoc",
    "parameter": "Cache::SizeAwareCache",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ASizeAwareCache/json",
    "generated": "2026-06-13T00:19:28Z",
    "synopsis": "use Cache::SizeAwareCache;\nuse vars qw( @ISA );\n@ISA = qw( Cache::SizeAwareCache );",
    "sections": {
        "NAME": {
            "content": "Cache::SizeAwareCache -- extends the Cache interface.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The SizeAwareCache interface is implemented by classes that support all of the Cache::Cache\ninterface in addition to the limitsize and maxsize features of a size aware cache.\n\nThe default cache size limiting algorithm works by removing cache objects in the following order\nuntil the desired limit is reached:\n\n1) objects that have expired\n2) objects that are least recently accessed\n3) objects that expire next\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Cache::SizeAwareCache;\nuse vars qw( @ISA );\n\n@ISA = qw( Cache::SizeAwareCache );\n",
            "subsections": []
        },
        "CONSTANTS": {
            "content": "Please see Cache::Cache for standard constants\n\n*$NOMAXSIZE*\nThe cache has no size restrictions\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Please see Cache::Cache for the standard methods\n",
            "subsections": [
                {
                    "name": "limit_size",
                    "content": "Attempt to resize the cache such that the total disk usage is under the *$newsize*\nparameter. *$newsize* represents t size (in bytes) that the cache should be limited to.\nNote that this is only a one time adjustment. To maintain the cache size, consider using the\n*maxsize* option, although it is considered very expensive, and can often be better\nachieved by periodically calling *limitsize*.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "Please see Cache::Cache for the standard options\n\n*maxsize*\nSets the maxsize property (size in bytes), which is described in detail below. Defaults to\n*$NOMAXSIZE*.\n",
            "subsections": []
        },
        "PROPERTIES": {
            "content": "Please see Cache::Cache for standard properties\n\n(get|set)maxsize\nIf this property is set, then the cache will try not to exceed the max size value (in bytes)\nspecified. NOTE: This causes the size of the cache to be checked on every set, and can be\nconsidered *very* expensive in some implementations. A good alternative approach is leave\nmaxsize as $NOMAXSIZE and to periodically limit the size of the cache by calling the\nlimitsize( $size ) method.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Cache::Cache\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Original author: DeWitt Clinton <dewitt@unto.net>\n\nLast author: $Author: dclinton $\n\nCopyright (C) 2001-2003 DeWitt Clinton\n",
            "subsections": []
        }
    },
    "summary": "Cache::SizeAwareCache -- extends the Cache interface.",
    "flags": [],
    "examples": [],
    "see_also": []
}