{
    "mode": "perldoc",
    "parameter": "Cache::CacheMetaData",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACacheMetaData/json",
    "generated": "2026-06-12T05:16:35Z",
    "synopsis": "use Cache::CacheMetaData;\nmy $cachemetadata = new Cache::CacheMetaData( );\nforeach my $key ( $cache->getkeys( ) )\n{\nmy $object = $cache->getobject( $key ) or\nnext;\n$cachemetadata->insert( $object );\n}\nmy $currentsize = $cachemetadata->getcachesize( );\nmy @removallist = $cachemetadata->buildremovallist( );",
    "sections": {
        "NAME": {
            "content": "Cache::CacheMetaData -- data about objects in the cache\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The CacheMetaData object is used by size aware caches to keep track of the state of the cache\nand efficiently return information such as an objects size or an ordered list of identifiers to\nbe removed when a cache size is being limited. End users will not normally use CacheMetaData\ndirectly.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Cache::CacheMetaData;\n\nmy $cachemetadata = new Cache::CacheMetaData( );\n\nforeach my $key ( $cache->getkeys( ) )\n{\nmy $object = $cache->getobject( $key ) or\nnext;\n\n$cachemetadata->insert( $object );\n}\n\nmy $currentsize = $cachemetadata->getcachesize( );\n\nmy @removallist = $cachemetadata->buildremovallist( );\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "new",
                    "content": "Construct a new Cache::CacheMetaData object\n"
                },
                {
                    "name": "insert",
                    "content": "Inform the CacheMetaData about the object *$object* in the cache.\n"
                },
                {
                    "name": "remove",
                    "content": "Inform the CacheMetaData that the object specified by *$key* is no longer in the cache.\n"
                },
                {
                    "name": "build_removal_list",
                    "content": "Create a list of the keys in the cache, ordered as follows:\n\n1) objects that expire now\n\n2) objects expiring at a particular time, with ties broken by the time at which they were\nleast recently accessed\n\n3) objects that never expire, sub ordered by the time at which they were least recently\naccessed\n\nNOTE: This could be improved further by taking the size into account on accessedat ties.\nHowever, this type of tie is unlikely in normal usage.\n"
                },
                {
                    "name": "build_object_size",
                    "content": "Return the size of an object specified by *$key*.\n"
                }
            ]
        },
        "PROPERTIES": {
            "content": "getcachesize\nThe total size of the objects in the cache\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Cache::Cache, Cache::CacheSizer, Cache::SizeAwareCache\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::CacheMetaData -- data about objects in the cache",
    "flags": [],
    "examples": [],
    "see_also": []
}