1Cache::Memory(3) User Contributed Perl Documentation Cache::Memory(3)
2
3
4
6 Cache::Memory - Memory based implementation of the Cache interface
7
9 use Cache::Memory;
10
11 my $cache = Cache::Memory->new( namespace => 'MyNamespace',
12 default_expires => '600 sec' );
13
14 See Cache for the usage synopsis.
15
17 The Cache::Memory class implements the Cache interface. This cache
18 stores data on a per-process basis. This is the fastest of the cache
19 implementations, but is memory intensive and data can not be shared
20 between processes. It also does not persist after the process dies.
21 However data will remain in the cache until cleared or it expires. The
22 data will be shared between instances of the cache object, a cache
23 object going out of scope will not destroy the data.
24
26 my $cache = Cache::Memory->new( %options )
27
28 The constructor takes cache properties as named arguments, for example:
29
30 my $cache = Cache::Memory->new( namespace => 'MyNamespace',
31 default_expires => '600 sec' );
32
33 See 'PROPERTIES' below and in the Cache documentation for a list of all
34 available properties that can be set.
35
37 See 'Cache' for the API documentation.
38
40 Cache::Memory adds the property 'namespace', which allows you to
41 specify a different caching store area to use from the default. All
42 methods will work ONLY on the namespace specified.
43
44 my $ns = $c->namespace();
45 $c->set_namespace( $namespace );
46
47 For additional properties, see the 'Cache' documentation.
48
50 Cache
51
53 Chris Leishman <chris@leishman.org>
54 Based on work by DeWitt Clinton <dewitt@unto.net>
55
57 Copyright (C) 2003-2006 Chris Leishman. All Rights Reserved.
58
59 This module is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
60 KIND, either expressed or implied. This program is free software; you
61 can redistribute or modify it under the same terms as Perl itself.
62
63 $Id: Memory.pm,v 1.9 2006/01/31 15:23:58 caleishm Exp $
64
65
66
67perl v5.28.0 2018-07-14 Cache::Memory(3)