Cache::Mmap Perl module helps you to share data cache using memory mapped files.
This module implements a shared data cache, using memory mapped files. If routines are provided which interact with the underlying data, access to the cache is completely transparent, and the module handles all the details of refreshing cache contents, and updating underlying data, if necessary.
Cache entries are assigned to "buckets" within the cache file, depending on the key. Within each bucket, entries are stored approximately in order of last access, so that frequently accessed entries will move to the head of the bucket, thus decreasing access time. Concurrent accesses to the same bucket are prevented by file locking of the relevant section of the cache file.
These methods are used to examine/update the configuration of a cache. Most of these methods are read-only, and the value returned may be different to that passed to the constructor, since the cache may have been created by an earlier process which specified different parameters.
Returns the number of buckets in the cache file.
Returns the size of buckets (in bytes) in the cache file.
Returns true if items not found in the underlying data are cached anyway.
Returns the context data for reads and writes to the underlying data.
Provides new context data for reads and writes to the underlying data.
Returns the time in seconds cache entries are considered valid for, or zero for indefinite validity.
Returns the page size (in bytes) of the cache file.
Returns true if the cache stores strings rather than references.
Returns true if items written to the cache are immediately written to the underlying data.