Quick Navigator

Search Site

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

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



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

Cache::AgainstFile::CacheModule - use Cache or Cache::Cache modules for Cache::AgainstFile

        use Cache::AgainstFile;
        my $cache = new Cache::AgainstFile(
                        Method => 'CacheModule',
                        CacheModule => 'Cache::MemoryCache', #This will be loaded on demand
                        CacheModuleOptions => {'default_expires_in' => 300},
                        # ...

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

This backend allows you to apply Cache::AgainstFile to any of the modules on CPAN that conform to the Cache::Cache or Cache interfaces. Data structures are automatically serialised into the cache.

The module to use for the cache implementation (e.g. Cache::MemoryCache)
A hashref of options to pass to the cache module's constructor
How long to defer statting the file (in seconds). This option is only any use with memory caches for two reasons:

First, for filesystem caches, the cost of fetching an item from the cache far exceeds the cost of statting a file.

Second, unlike the file modification time which is stored within the cache itself, the history of when files were last statted is held in memory, so that the cache does not need to be reserialised on each stat. Therefore the stat history is not shared between processes.

Be careful if you use this in modperl environments as it will result in some children having a new version of the cached item, and some still having the old version.

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)

Setting this to 1 is equivalent to setting Grace to an infinite value.

$Revision: 1.9 $ on $Date: 2005/10/31 21:10:41 $ by $Author: johna $

John Alden <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

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.