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
40
41
42perl v5.38.2 2023-D1B2I-x0:4:SearchBuilder::Record::Cachable(3)