Cache::SharedMemoryCache — extends the MemoryCache.
| Use Case | Command | Description |
|---|---|---|
| Create a shared memory cache | my $cache = new Cache::SharedMemoryCache(\%options); | Instantiate with namespace and expiration |
| Set a cache entry | $cache->set('key', $value, $expires_in); | Store value with optional expiration |
| Get a cache entry | $cache->get('key'); | Retrieve value or undef if not found |
| Use namespaces | namespace => 'MyNamespace' | Separate cache domains |
The SharedMemoryCache extends the MemoryCache class and binds the data store to shared memory so that separate process can use the same cache.
The official recommendation is now to use FileCache instead of SharedMemoryCache. The reasons for this include:
use Cache::SharedMemoryCache;
my %cache_options_= ( 'namespace' => 'MyNamespace',
'default_expires_in' => 600 );
my $shared_memory_cache =
new Cache::SharedMemoryCache( \%cache_options ) or
croak( "Couldn't instantiate SharedMemoryCache" );
See Cache::Cache for the API documentation.
See Cache::Cache for the standard options.
See Cache::Cache for the default properties.
Cache::Cache, Cache::MemoryCache
Original author: DeWitt Clinton <dewitt AT unto.net>
Last author: $Author: dclinton $
Copyright (C) 2001-2003 DeWitt Clinton
Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-26 01:31 @216.73.217.127
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)