Cache::SharedMemoryCache — extends the MemoryCache.
| Use Case | Command | Description |
|---|---|---|
| 🔧 Create a shared memory cache | my $cache = new Cache::SharedMemoryCache(\%options); | Instantiate a new shared memory cache with namespace and expiration options |
| 📁 Set namespace | 'namespace' => 'MyNamespace' | Isolate cache entries under a unique namespace |
| ⏱️ Set default expiration | 'default_expires_in' => 600 | Entries expire after 600 seconds (10 minutes) by default |
| 📚 Use standard Cache API | See Cache::Cache | All methods from Cache::Cache are inherited (get, set, remove, etc.) |
| ⚠️ Migration recommendation | Use FileCache instead | FileCache is now recommended over SharedMemoryCache for performance, scalability, and portability |
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
perl v5.20.2 2014-09-17 Cache::SharedMemoryCache(3pm)
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-12 06:47 @2600:1f28:365:80b0:6f72:a904:73b0:e266
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)