Eric Andreychek > OpenPlugin-0.11 > OpenPlugin::Cache

Download:
OpenPlugin-0.11.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View Bugs
Report a bug
Module Version: 1.17   Source  

NAME ^

OpenPlugin::Cache - Base class for putting data in and getting information out of a cache

SYNOPSIS ^

 use OpenPlugin();
 $OP = OpenPlugin->new();
 my $id = $OP->cache->save( $large_data_set );

 ...

 my $data = $OP->cache->fetch( $id );

DESCRIPTION ^

This plugin is designed to save data to a cache, and later retrieve that information from that cache. It is very similar to sessions, but data which is cached is meant for all users. Session data is only meant for the user associated with that particular session.

Data you'd typically want to cache includes information returned which requires a lot of time or processing to retrieve. One example is large database queries.

METHODS ^

fetch( $id )

Retrieves whatever is in the cache tagged by $id.

save( $data, { id = $id, expires => $date })>

Saves data into the cache.

Returns: the cache ID used on success, undef on failure.

Basic parameters -- drivers may define others:

delete( $id )

Delete an existing item from the cache.

Returns true if successful.

BUGS ^

None known.

TO DO ^

See the TO DO list in the OpenPlugin::Session plugin.

SEE ALSO ^

Cache::Cache

COPYRIGHT ^

Copyright (c) 2001-2003 Eric Andreychek. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS ^

Eric Andreychek <eric@openthought.net>