John Millaway

NAME

Cache::FastMemoryCache - In-memory cache of arbitrary data.

SYNOPSIS

  use Cache::FastMemoryCache;

  my $cache = new Cache::FastMemoryCache({ 'namespace' => 'MyNamespace' });
  $key = 'xxx';
  $href->{'name'} = 'old name';
  
  $cache->set( $key, $href );   # insert into cache.
  $href->{'name'} = 'new name'; # modify it after insert.

  # Later...

  $href = $cache->get($key);
  print $href->{'name'};        # prints "new name"
  

DESCRIPTION

Cache::FastMemoryCache is an in-memory cache, implemented as an extension to the excellent Cache::Cache suite. All cached items are stored per-process. The cache does not persist after the process dies. It is the fastest of all the Cache::* types because it does not perform deep copying of data.

METHODS

See Cache::Cache for the API.

CAVEATS

The other Cache::* types make deep copies of data before inserting it into the cache -- FastMemoryCache does not make copies.

The example in the SYNOPSIS section of this manual prints "new name" with FastMemoryCache, but prints "old name" with other cache types!

AUTHOR

John Millaway <millaway@acm.org>

(Based heavily on DeWitt Clinton's Cache::MemoryCache module.)

SEE ALSO

Cache::Cache, Cache::MemoryCache.