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.
11 # The module can cache a fixed set of attributes per key.
12 # It can be listed in "authorize", "post-auth", "pre-proxy"
15 # If you want different things cached for authorize and post-auth,
16 # you will need to define two instances of the "cache" module.
18 # The module returns "ok" if it found or created a cache entry.
19 # The module returns "updated" if it merged a cached entry.
20 # The module returns "noop" if it did nothing.
21 # The module returns "fail" on error.
24 # The backend datastore used to store the cache entries.
25 # Current datastores are
26 # rlm_cache_rbtree - An in memory, non persistent rbtree based datastore.
27 # Useful for caching data locally.
28 # rlm_cache_memcached - A non persistent "webscale" distributed datastore.
29 # Useful if the cached data need to be shared between
30 # a cluster of RADIUS servers.
31 # driver = "rlm_cache_rbtree"
34 # Some drivers accept specific options, to set them a
35 # config section with the the name as the driver should be added
36 # to the cache instance.
38 # Driver specific options are:
41 # # Memcached configuration options, as documented here:
42 # # http://docs.libmemcached.org/libmemcached_configuration.html#memcached
43 # options = "--SERVER=localhost"
46 # start = ${thread[pool].start_servers}
47 # min = ${thread[pool].min_spare_servers}
48 # max = ${thread[pool].max_servers}
49 # spare = ${thread[pool].max_spare_servers}
56 # The key used to index the cache. It is dynamically expanded
60 # The TTL of cache entries, in seconds. Entries older than this
63 # This value should be between 10 and 86400.
66 # You can flush the cache via
68 # radmin -e "set module config cache epoch 123456789"
70 # Where last value is a 32-bit Unix timestamp. Cache entries older
71 # than this are expired, as new entries added.
73 # You should never set the "epoch" configuration item in this file.
75 # If yes the following attributes will be added to the request:
76 # * &request:Cache-Entry-Hits - The number of times this entry
79 # Note: Not supported by the rlm_cache_memcached module.
83 # The list of attributes to cache for a particular key.
85 # Each key gets the same set of cached attributes. The attributes
86 # are dynamically expanded at run time.
88 # The semantics of this construct are identical to an unlang
89 # update block, except the left hand side of the expression
90 # represents the cache entry. see man unlang for more information
93 # Note: Only request, reply, control and session-state lists
94 # are available in cache entries. Attempting to store attributes
95 # in other lists will raise an error during config validation.
98 # <list>:<attribute> <op> <value>
100 # Cache all instances of Reply-Message in the reply list
101 &reply:Reply-Message += &reply:Reply-Message
103 # Add our own to show when the cache was last updated
104 &reply:Reply-Message += "Cache last updated at %t"
106 &reply:Class := "%{randstr:ssssssssssssssssssssssssssssssss}"
109 # This module supports a number of runtime configuration parameters
110 # represented by attributes in the &control: list.
112 # &control:Cache-TTL - Sets the TTL of an entry to be created, or
113 # modifies the TTL of an existing entry.
114 # - Setting a Cache-TTL of > 0 means set the TTL of the entry to
115 # the new value (and reset the expiry timer).
116 # - Setting a Cache-TTL of < 0 means expire the existing entry
117 # (without merging) and create a new one with TTL set to
119 # - Setting a Cache-TTL of 0 means expire the existing entry
120 # (without merging) and don't create a new one.
122 # &control:Cache-Status-Only - If present and set to 'yes' will
123 # prevent a new entry from being created, and existing entries from
124 # being merged. It will also alter the module's return codes.
125 # - The module will return "ok" if a cache entry was found.
126 # - The module will return "notfound" if no cache entry was found.
128 # &control:Cache-Read-Only - If present and set to 'yes' will
129 # prevent a new entry from being created, but will allow existing
130 # entries to be merged. It will also alter the module's return codes.
131 # - The module will return "updated" if a cache entry was found.
132 # - The module will return "notfound" if no cache was found.
134 # &control:Cache-Merge - If present and set to 'yes' will merge new
135 # cache entries into the current request. Useful if results
136 # of execs or expansions are stored directly in the cache.
138 # All runtime configuration attributes will be removed from the
139 # &control: list after the cache module is called.