1DBIx::SearchBuilder::ReUcsoerrd:C:oCnatcrhiabbultee(d3D)PBeIrxl::DSoecaurmcehnBtuaitlidoenr::Record::Cachable(3)
2
3
4
6 DBIx::SearchBuilder::Record::Cachable - Records with caching behavior
7
9 package MyRecord;
10 use base qw/DBIx::SearchBuilder::Record::Cachable/;
11
13 This module subclasses the main DBIx::SearchBuilder::Record package to
14 add a caching layer.
15
16 The public interface remains the same, except that records which have
17 been loaded in the last few seconds may be reused by subsequent fetch
18 or load methods without retrieving them from the database.
19
21 FlushCache
22 This class method flushes the _global_
23 DBIx::SearchBuilder::Record::Cachable cache. All caches are immediately
24 expired.
25
26 _FlushKeyCache
27 Blow away this record type's key cache
28
29 _CacheConfig
30 You can override this method to change the duration of the caching from
31 the default of 5 seconds.
32
33 For example, to cache records for up to 30 seconds, add the following
34 method to your class:
35
36 sub _CacheConfig {
37 { 'cache_for_sec' => 30 }
38 }
39
41 Matt Knopp <mhat@netlag.com>
42
44 DBIx::SearchBuilder, DBIx::SearchBuilder::Record
45
46
47
48perl v5.30.0 2019-D0B7I-x2:6:SearchBuilder::Record::Cachable(3)