# Cache::CacheSizer - - component object for managing the size of caches - perldoc - [phpMan]

## NAME
    [Cache::CacheSizer](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACacheSizer/markdown) -- component object for managing the size of caches

## DESCRIPTION
    The CacheSizer class is used internally in SizeAware caches such as SizeAwareFileCache to
    encapsulate the logic of limiting cache size.

## SYNOPSIS
      use [Cache::CacheSizer](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACacheSizer/markdown);

      my $sizer = new [Cache::CacheSizer](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACacheSizer/markdown)( $cache, $max_size );

      $sizer->limit_size( $new_size );

## METHODS
### new
        Construct a new [Cache::CacheSizer](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACacheSizer/markdown) object for the cache *$cache* with a maximum size of
        *$max_size*.

### update_access_time
        Inform the cache that the object specified by *$key* has been accessed.

### limit_size
        Use the sizing algorithms to get the cache down under *$new_size* if possible.

## PROPERTIES
    get_max_size
        The desired size limit for the cache under control.

## SEE ALSO
    [Cache::Cache](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACache/markdown), [Cache::CacheMetaData](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ACacheMetaData/markdown), [Cache::SizeAwareCache](https://www.chedong.com/phpMan.php/perldoc/Cache%3A%3ASizeAwareCache/markdown)

## AUTHOR
    Original author: DeWitt Clinton <<dewitt@unto.net>>

    Last author: $Author: dclinton $

    Copyright (C) 2001-2003 DeWitt Clinton

