GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Cache::AgainstFile::Storable(3) User Contributed Perl Documentation Cache::AgainstFile::Storable(3)

Cache::AgainstFile::Storable - cache data structures parsed from files in Storable files

        use Cache::AgainstFile;
        my $cache = new Cache::AgainstFile(
                \&loader, 
                {
                        Method => 'Storable',
                        CacheDir => '/var/tmp/cache/myapp',
                        # ...
                }
        );

        $data = $cache->get($filename);

Data structures parsed from files are cached in "shadow" storable files. If parsing is significantly more expensive than file I/O (e.g. with XML files), then this will offer some benefit.

This backend is suitable for non-persistent environments (e.g. CGI scripts) where you want the cache to outlive the process. For persistent environments, the Memory backend may be more suitable as it saves on file I/O.

count() and size() are relatively expensive operations involving scanning the cache directory.

CacheDir
Directory in which to store cache files. This is mandatory.
MaxATime
Purge items older than this. Value is in seconds (default=undefined=infinity)
MaxItems
Purge oldest items from the cache to reduce the number of items in the cache to be at most this number. Value should be an integer (default=undefined=infinity)
NoStat
Don't stat files to validate the cache - items are served from the cache until they are purged. Valid values are 0|1 (default=0, i.e. files are statted)
Locking
Valid values are Flock and AtomicWrite (default is AtomicWrite). If neither of these are to your taste, consider using Cache::AgainstFile::CacheModule with another caching module. Some other file caching modules on CPAN are:
Cache::FileCache
This uses atomic writes.
Cache::File
This uses File::NFSLock for locking (no locking is also an option)

$Revision: 1.22 $ on $Date: 2006/05/09 09:02:32 $ by $Author: mattheww $

John Alden & Piers Kent <cpan _at_ bbc _dot_ co _dot_ uk>

(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL.

See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt

2006-05-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.