Andy Grundman > DBIx-Class-0.03003 > DBIx::Class::ObjectCache

Download:
DBIx-Class-0.03003.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  12
Open  16
Stalled  11
View/Report Bugs
Source   Latest Release: DBIx-Class-0.04999_06

NAME ^

    DBIx::Class::ObjectCache - Cache rows by primary key (EXPERIMENTAL)

SYNOPSIS ^

    # in your class definition
    use Cache::FastMmmap;
    __PACKAGE__->cache(Cache::FastMmap->new);

DESCRIPTION ^

This class implements a simple object cache. It should be loaded before most (all?) other DBIx::Class components. Note that, in its current state, this code is rather experimental. The only time the cache is made use of is on calls to $obj->find. This can still result in a significant savings, but more intelligent caching, e.g. of the resultset of a has_many call, is currently not possible. It is not difficult, however, to implement additional caching on top of this module.

The cache is stored in a package variable called cache. It can be set to any object that implements the required get, set, and remove methods.

AUTHORS ^

David Kamholz <davekam@pobox.com>

LICENSE ^

You may distribute this code under the same terms as Perl itself.

syntax highlighting: