man > Cache::SharedMemoryCache(3pm)

📄 NAME

Cache::SharedMemoryCache — extends the MemoryCache.

🚀 Quick Reference

Use CaseCommandDescription
Create shared memory cachemy $c = Cache::SharedMemoryCache->new({ namespace => 'MyNS', default_expires_in => 600 });Instantiate with namespace and default expiration
Store data$c->set($key, $value);Store a value under a key
Retrieve datamy $value = $c->get($key);Get the value for a key
Remove data$c->remove($key);Remove an entry
Clear entire cache$c->clear();Remove all entries

📘 DESCRIPTION

The SharedMemoryCache extends the MemoryCache class and binds the data store to shared memory so that separate processes can use the same cache.

The official recommendation is now to use FileCache instead of SharedMemoryCache. The reasons for this include:

  1. 📁 FileCache provides equal or better performance in all cases that we've been able to test. This is due to all modern OS's ability to buffer and cache file system accesses very well.
  2. 🔢 FileCache has no real limits on cached object size or the number of cached objects, whereas the SharedMemoryCache has limits, and rather low ones at that.
  3. 💻 FileCache works well on every OS, whereas the SharedMemoryCache works only on systems that support IPC::ShareLite. And IPC::ShareLite is an impressive effort — but think about how hard it is to get shared memory working properly on *one* system. Now imagine writing a wrapper around shared memory for many operating systems.

📜 SYNOPSIS

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" );

🔧 METHODS

See Cache::Cache for the API documentation.

⚙️ OPTIONS

See Cache::Cache for the standard options.

🏷️ PROPERTIES

See Cache::Cache for the default properties.

🔗 SEE ALSO

✍️ AUTHOR

Original author: DeWitt Clinton <dewitt AT unto.net>

Last author: $Author: dclinton $

Copyright (C) 2001-2003 DeWitt Clinton

Cache::SharedMemoryCache(3pm)
📄 NAME 🚀 Quick Reference 📘 DESCRIPTION 📜 SYNOPSIS 🔧 METHODS ⚙️ OPTIONS 🏷️ PROPERTIES 🔗 SEE ALSO ✍️ AUTHOR

Generated by phpman v4.9.25-3-gdbaf087 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-06 19:37 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format