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


Cache-FastMemoryCache documentation  | view source Contained in the Cache-FastMemoryCache distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

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

Top

See Cache::Cache for the API.

CAVEATS

Top

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

Top

John Millaway <millaway@acm.org>

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

SEE ALSO

Top

Cache::Cache, Cache::MemoryCache.


Cache-FastMemoryCache documentation  | view source Contained in the Cache-FastMemoryCache distribution.