---
name: "Cache::CacheSizer"
section: "3pm"
platform: "linux"
package: "libcache-cache-perl"
version: "1.08-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Cache::CacheSizer"
---

# Cache::CacheSizer(3pm)

## NAME

Cache::CacheSizer -- 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;
  my $sizer = new Cache::CacheSizer( $cache, $max_size );
  $sizer->limit_size( $new_size );
```

## METHODS

- **new( $cache, $max\_size )**

  Construct a new Cache::CacheSizer object for the cache *$cache* with a maximum size of *$max\_size*.

- **update\_access\_time( $key )**

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

- **limit\_size( $new\_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, Cache::CacheMetaData, Cache::SizeAwareCache

## AUTHOR

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

Last author:     `$Author:` dclinton $

Copyright (C) 2001-2003 DeWitt Clinton
