07c0722ebff34ce616164c1ac1ed6953ea495dfc
[freeradius.git] / raddb / mods-available / cache
1 # -*- text -*-
2 #
3 #  $Id$
4
5 #
6 #       A module to cache attributes.  The idea is that you can look
7 #       up information in a database, and then cache it.  Repeated
8 #       requests for the same information will then have the cached
9 #       values added to the request.
10 #
11 #       The module can cache a fixed set of attributes per key.
12 #       It can be listed in "authorize", "post-auth", "pre-proxy"
13 #       and "post-proxy".
14 #
15 #       If you want different things cached for authorize and post-auth,
16 #       you will need to define two instances of the "cache" module.
17 #
18 #       The module returns "ok" if it found a cache entry.
19 #       The module returns "updated" if it added a new cache entry.
20 #       The module returns "noop" if it did nothing.
21 #
22 cache {
23         #  The key used to index the cache.  It is dynamically expanded
24         #  at run time.
25         key = "%{User-Name}"
26
27         #  The TTL of cache entries, in seconds.  Entries older than this
28         #  will be expired.
29         #
30         #  You can set the TTL per cache entry, but adding a control
31         #  variable "Cache-TTL".  The value there will over-ride this one.
32         #  Setting a Cache-TTL of 0 means "delete this entry".
33         #
34         #  This value should be between 10 and 86400.
35         ttl = 10
36
37         #  A timestamp used to flush the cache, via
38         #
39         #       radmin -e "set module config cache epoch 123456789"
40         #
41         #  Where last value is a 32-bit Unix timestamp.  Cache entries
42         #  older than this are expired, and new entries added.
43         #
44         #  You should ALWAYS leave it as "epoch = 0" here.
45         epoch = 0
46         
47         #  The module can also operate in status-only mode where it will
48         #  not add new cache entries, or merge existing ones.
49         #
50         #  To enable set the control attribute "Cache-Status-Only" to "yes"
51         #  The module will return "ok" if it found a cache entry.
52         #  The module will return "notfound" if it failed to find a cache entry,
53         #  or the entry had expired.
54         #
55         #  Note: expired entries will still be removed.
56
57         #  If yes the following attributes will be added to the request list:
58         #       * Cache-Entry-Hits - The number of times this entry has been
59         #                            retrieved.
60         add-stats = no
61
62         #  The list of attributes to cache for a particular key.
63         #  Each key gets the same set of cached attributes.
64         #  The attributes are dynamically expanded at run time.
65         #
66         #  You can specify which list the attribute goes into by
67         #  prefixing the attribute name with the list.  This allows
68         #  you to update multiple lists with one configuration.
69         #
70         #  If no list is specified the request list will be updated.
71         update cache {
72                 # list:Attr-Name
73                 reply:Reply-Message += "I'm the cached reply from %t"
74
75                 control:Class := 0x010203
76         }
77 }