1 .TH SLAPO-PCACHE 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2004 The OpenLDAP Foundation, All Rights Reserved.
3 .\" Copying restrictions apply. See the COPYRIGHT file.
4 .\" Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
7 slapo-pcache \- proxycache overlay
15 allows caching of LDAP search requests (queries) in a local database.
16 For an incoming query, the
17 proxy cache determines its corresponding \fBtemplate\fP. If the template
18 was specified as cacheable using the \fBproxytemplate\fP directive
19 and the request is contained in a cached request, it is answered from
21 Otherwise, the search is performed as usual and cacheable search results
22 are saved in the cache for use in future queries.
25 A template is defined by a filter string and an index identifying a set of
26 attributes. The \fBtemplate string\fP for a query can be obtained by
27 removing assertion values from the RFC 2254 representation of its search
28 filter. A query belongs to a template if its template string and set of
29 projected attributes correspond to a cacheable template. Examples of template strings are (mail=), (|(sn=)(cn=)), (&(sn=)(givenName=)).
32 The following cache specific directives can be used to configure the proxy
36 This directive adds the proxycache overlay to the current backend. The
37 proxycache overlay may be used with any backend but is intended for use
45 .B proxycache <database> <max_entries> <numattrsets> <entry_limit> <cc_period>
46 The directive enables proxy caching in the current backend and sets general
47 cache parameters. A <database> backend will be used internally to maintain
48 the cached entries. The chosen database will need to be configured as well,
49 as shown below. Cache replacement is invoked when the cache size grows to
50 <max_entries> entries and continues till the cache size drops below this size.
51 <numattrsets> should be equal to the number of following \fBproxyattrset\fP
52 directives. Queries are cached only if they correspond to a cacheable template
53 (specified by the \fBproxytemplate\fP directive) and the number of entries
54 returned is less than <entry_limit>. Consistency check is performed every
55 <cc_period> duration (specified in secs). In each cycle queries with expired
56 "time to live(\fBTTL\fP)" are removed. A sample cache configuration is:
59 proxycache \fBbdb 10000 1 50 100\fP
62 .B proxyattrset <index> <attrs...>
63 Used to associate a set of attributes <attrs..> with an <index>. Each attribute
64 set is associated with an integer from 0 to <numattrsets>-1. These indices are
65 used by the \fBproxytemplate\fP directive to define cacheable templates.
68 .B proxytemplate <template_string> <attrset_index> <ttl>
69 Specifies a cacheable template and "time to live" (in sec) <ttl> of queries
70 belonging to the template.
73 The following adds a template with filter string (&sn=)(givenName=)) and attributes mail, postaladdress, telephonenumber and a TTL of 1 hour.
77 proxyattrset \fB0 mail postaladdress telephonenumber\fP
78 proxytemplate \fB(&(sn=)(givenName=)) 0 3600\fP
82 Directives for configuring the underlying database must also be given, as
87 directory /var/tmp/cache
92 Any valid directives for the chosen database type may be used.
96 default slapd configuration file
105 Originally implemented by Apurva Kumar as an extension to back-meta;
106 turned into an overlay by Howard Chu.