DBIx::Class::ObjectCache - Cache rows by primary key |
DBIx::Class::ObjectCache - Cache rows by primary key (EXPERIMENTAL)
# in your class definition use Cache::FastMmap; __PACKAGE__->cache(Cache::FastMmap->new);
This class implements a simple object cache. It should be loaded before most (all?) other the DBIx::Class manpage 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.
David Kamholz <dkamholz@cpan.org>
You may distribute this code under the same terms as Perl itself.
DBIx::Class::ObjectCache - Cache rows by primary key |