Cache::MemoryCache(3pm) β User Contributed Perl Documentation
Cache::MemoryCache β implements the Cache interface.
| Use Case | Command | Description |
|---|---|---|
| Create a memory cache | my $cache = new Cache::MemoryCache({ 'namespace' => 'MyNS', 'default_expires_in' => 600 }); |
Instantiate a per-process memory cache with namespace and default expiry π§ |
| Store data | $cache->set( $key, $data, $expires_in ); |
Save data under a key, optionally overriding expiry β³ |
| Retrieve data | my $data = $cache->get( $key ); |
Fetch data by key; returns undef if missing or expired π |
βΉοΈ Full API & options βΆ Cache::Cache
The MemoryCache class implements the Cache interface. This cache stores data on a perβprocess basis. It is the β‘ fastest of the cache implementations, but data π cannot be shared between processes. Data remains in the cache until it is cleared, expires, or the process dies β»οΈ. The cache object simply going out of scope will not destroy the data π¬οΈ.
use Cache::MemoryCache;
my $cache = new Cache::MemoryCache( { 'namespace' => 'MyNamespace',
'default_expires_in' => 600 } );
π¦ Cache::MemoryCache module. See Cache::Cache for the usage synopsis.
βΉοΈ See Cache::Cache for the API documentation.
βΉοΈ See Cache::Cache for standard options.
βΉοΈ See Cache::Cache for default properties.
Original author: DeWitt Clinton <dewitt AT unto.net>
Last author: $Author: dclinton $
Copyright (C) 2001-2003 DeWitt Clinton
Generated by phpman v4.9.25-3-gdbaf087 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-06 22:53 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format