1Catalyst::Plugin::CacheU:s:eSrtoCroen(t3r)ibuted Perl DoCcautmaelnytsatt:i:oPnlugin::Cache::Store(3)
2
3
4
6 Catalyst::Plugin::Cache::Store - how to write a Cache store plugin.
7
9 package Catalyst::Plugin::Cache::Store::Frobnicator;
10
11 sub setup_frobnicator_cache_backend {
12 my ( $app, $name, $config ) = @_;
13
14 ....
15
16 $app->register_cache_backend( $name => $cache_object );
17 }
18
20 In order to write a cache store plugin, all you need is to implement a
21 method following the naming convention:
22
23 setup_<<lower case store name>>_cache_backend {
24
25 }
26
27 For example "setup_fastmmap_cache_backend" for
28 Catalyst::Plugin::Cache::Store::FastMmap.
29
30 and call "register_cache_backend" from within that.
31
32 The method will get the backend name and configuration as it's first
33 and second arguments.
34
35 All invokation of the setup methods will be automatic, based on the
36 configuration. However, the plugin must be loaded by the user.
37
38 Note that store plugins are only necessary if some configuration
39 defaults that are catalyst specific need to be provided.
40
41 For most cases simply using a cache class instead of a plugin is
42 sufficient.
43
44
45
46perl v5.38.0 2023-07-20 Catalyst::Plugin::Cache::Store(3)