Class-DBI-Cacheable
view release on metacpan or search on metacpan
Class::DBI::Cacheable version 0.01
==================================
package YourApp::DB;
use base 'Class::DBI::Cacheable';
__PACKAGE__->set_db( Main => 'dbi:Pg:dbname=database', 'username', 'password' );
Class::DBI::Cacheable transparently provides cache support to your Class::DBI
framework, with setting, getting and removing of cache entries handled for you.
This can drastically increase performance of applications that use Class::DBI
extensively, since repeated retrievals of the same data from a database is
prevented.
Class::DBI::Cacheable is highly configurable to your application; see the
documentation for more information.
INSTALLATION
lib/Class/DBI/Cacheable.pm view on Meta::CPAN
Class::DBI::Cacheable - Class::DBI object cache framework
=head1 SYNOPSIS
package YourApp::DB;
use base 'Class::DBI::Cacheable';
__PACKAGE__->set_db( Main => 'dbi:Pg:dbname=database', 'username', 'password' );
=head1 DESCRIPTION
Class::DBI::Cacheable transparently acts as a cacheing wrapper around L<Class::DBI>, storing
retrieved and created data in a local object cache, and returning data out of the cache
wherever possible.
Intended for better performance of L<Class::DBI>-based applications, this can prevent unnecessary
database queries by using previously-retrieved object data rather than having to go to the
database server every time a object is retrieved.
It is highly configurable so you can customize both on an per-application and per-class basis
the directory root where objects are stored, expire times, and other important parameters.
lib/Class/DBI/ObjectCache.pm view on Meta::CPAN
sub set {
my $self = shift;
$self->setCache();
}
=head1 DESCRIPTION
This method is a generic base-class used for storing and retrieving objects
to and from a L<Cache::Cache> framework. This is extended by L<Class::DBI::Cacheable>
to provide transparent L<Class::DBI> caching support, though it can be used
for other types of objects as well.
=head1 Method Reference
=cut
=head2 CLASS->getCacheKey( [$data] )
This method composes a unique key to represent this cache with. This
is used when storing the object in the cache, and for later retrieving
( run in 0.336 second using v1.01-cache-2.11-cpan-0a6323c29d9 )