Cache-AgainstFile

 view release on metacpan or  search on metacpan

lib/Cache/AgainstFile.pm  view on Meta::CPAN

Items which are not stale remain in the cache.

=item clear()

Dumps the entire cache (including items which are not stale)

=item count()

Returns the number of items in the cache.  Note that this method (present in the Cache API) 
is an addition to the Cache::Cache API.
 
=item size()

Returns the total size of the cache in bytes
(may return undef if this is not implemented in the backend) 
 
=back

=head1 WARNINGS

If you are caching blessed objects to disk either using the Storable backend
or a filesystem caching module through Cache::AgainstFile::CacheModule, make sure
the code for the class has been compiled into the process you are loading cache items into.
Normally this isn't a problem if you explicitly C<use> the class, but if you are loading
classes at runtime, make sure that the appropriate class is loaded before any objects of that
class are fetched from cache.

Different backends may adopt slightly different rules regarding checking
the source file's mtime. Any approach could be vulnerable to odd conditions
which result in the source file at any given time having more than one
possible set of contents (e.g. multiple nonatomic writes in a second)
or the use of utilities (such as tar) which change contents, then set mtime
to some time in the past. The default behaviour should be pretty resilient
but you may want to pay attention to Locking options if using the Storable
backend.

=head1 SEE ALSO

=over 4

=item L<Cache::AgainstFile::Memory>

In-memory cache.

=item L<Cache::AgainstFile::Storable>

On-disk cache using storable to serialize data structures.

=item L<Cache::AgainstFile::CacheModule>

Modules with the following interfaces can be used as the caching implementation:

=over 4

=item L<Cache::Cache>

a set of modules for lazy caching

=item L<Cache> 

a rewrite of Cache::Cache with extra features such as validation callbacks

=back

=back

=head1 VERSION

$Revision: 1.16 $ on $Date: 2006/05/09 09:04:29 $ by $Author: mattheww $

=head1 AUTHOR

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

=head1 COPYRIGHT

(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 

=cut



( run in 2.972 seconds using v1.01-cache-2.11-cpan-cdf2f3d4e48 )