NAME

Cache::SizeAwareMemoryCache -- extends the Cache::MemoryCache module

DESCRIPTION

The Cache::SizeAwareMemoryCache module adds the ability to dynamically limit the size (in bytes) of a memory based cache. It offers the new 'max_size' option and the 'limit_size( $size )' method. Please see the documentation for Cache::MemoryCache for more information.

SYNOPSIS

  use Cache::SizeAwareMemoryCache;

  my %cache_options = ( 'namespace' => 'MyNamespace',
			'default_expires_in' => 600,
                        'max_size' => 10000 );

  my $size_aware_memory_cache =
    new Cache::SizeAwareMemoryCache( \%cache_options ) or
      croak( "Couldn't instantiate SizeAwareMemoryCache" );

METHODS

Clear( )

See Cache::Cache

Purge( )

See Cache::Cache

Size( )

See Cache::Cache

new( $options_hash_ref )

Constructs a new SizeAwareMemoryCache

$options_hash_ref

A reference to a hash containing configuration options for the cache. See the section OPTIONS below.

clear( )

See Cache::Cache

get( $identifier )

See Cache::Cache

get_object( $identifier )

See Cache::Cache

limit_size( $new_size )

See Cache::SizeAwareCache

purge( )

See Cache::Cache

remove( $identifier )

See Cache::Cache

set( $identifier, $data, $expires_in )

See Cache::Cache

size( )

See Cache::Cache

OPTIONS

See Cache::Cache for standard options. Additionally, options are set by passing in a reference to a hash containing any of the following keys:

max_size

See Cache::SizeAwareCache

PROPERTIES

See Cache::Cache for default properties.

(get|set)_max_size

See Cache::SizeAwareCache

SEE ALSO

Cache::Cache, Cache::MemoryCache, Cache::SizeAwareFileCache

AUTHOR

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

Last author: $Author: dclinton $

Copyright (C) 2001 DeWitt Clinton