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 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.
cache
get
set
remove
David Kamholz <dkamholz@cpan.org>
You may distribute this code under the same terms as Perl itself.
To install DBIx::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class
CPAN shell
perl -MCPAN -e shell install DBIx::Class
For more information on module installation, please visit the detailed CPAN module installation guide.