]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_cache.3
Generate man page date from version.sh
[openldap] / doc / man / man3 / ldap_cache.3
1 .TH LDAP_CACHE 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_enable_cache, ldap_disable_cache, ldap_destroy_cache, ldap_flush_cache, ldap_uncache_entry, ldap_uncache_request, ldap_set_cache_options \- LDAP client caching routines
7 .SH SYNOPSIS
8 .nf
9 .ft B
10 #include <ldap.h>
11 .ft
12 .LP
13 .ft B
14 ldap_enable_cache( ld, timeout, maxmem )
15 .ft
16 LDAP    *ld;
17 long    timeout;
18 long    maxmem;
19 .LP
20 .ft B
21 void ldap_disable_cache( ld )
22 .ft
23 LDAP    *ld;
24 .LP
25 .ft B
26 void ldap_destroy_cache( ld )
27 .ft
28 LDAP    *ld;
29 .LP
30 .ft B
31 void ldap_flush_cache( ld )
32 .ft
33 LDAP    *ld;
34 .LP
35 .ft B
36 void ldap_uncache_entry( ld, dn )
37 .ft
38 LDAP    *ld;
39 char    *dn;
40 .LP
41 .ft B
42 void ldap_uncache_request( ld, msgid )
43 .ft
44 LDAP    *ld;
45 int     msgid;
46 .LP
47 .ft B
48 void ldap_set_cache_options( ld, opts )
49 .ft
50 LDAP            *ld;
51 unsigned long   opts;
52 .fi
53 .SH DESCRIPTION
54 .LP
55 These routines are used to control the behavior of the
56 .B experimental
57 client caching of
58 .BR ldap_search (3)
59 and
60 .BR ldap_compare (3)
61 operations.  By
62 default, the cache is disabled and no caching is done.  Enabling the
63 cache can greatly improve performance and reduce network bandwidth when
64 a client DUA makes repeated requests.
65 .LP
66 .B ldap_enable_cache()
67 should be called to turn on local caching or to
68 change cache parameters (lifetime of cached requests and memory used).
69 The \fIld\fP parameter should be the result of a successful call to
70 .BR ldap_open (3).
71 The \fItimeout\fP is specified in seconds, and is used to
72 decide how long to keep cached requests.  The \fImaxmem\fP value is in
73 bytes, and is used to set an upper bound on how memory the cache will
74 use.  You can specify 0 for \fImaxmem\fP to restrict the cache size by
75 the \fItimeout\fP only.  The first call to ldap_enable_cache creates
76 the cache; subsequent calls re-enable the cache and set the timeout and
77 memory values.
78 .LP
79 .B ldap_disable_cache()
80 temporarily disables use of the cache (new
81 requests are not cached and the cache is not checked when returning
82 results).  It does not delete the cache contents.
83 .LP
84 .B ldap_destroy_cache()
85 turns off caching and completely removes the cache from memory.
86 .LP
87 .B ldap_flush_cache()
88 deletes the cache contents, but does not effect it in any other way.
89 .LP
90 .B ldap_uncache_entry()
91 removes all requests that make reference to the
92 distinguished name \fIdn\fP from the cache.  It should be used, for
93 example, after doing an
94 .BR ldap_modify (3)
95 call involving \fIdn\fP.
96 .LP
97 .B ldap_uncache_request()
98 removes the request indicated by the LDAP request
99 id \fImsgid\fP from the cache.
100 .LP
101 .B ldap_set_cache_options()
102 is used to change caching behavior.  The current supported options are
103 .B LDAP_CACHE_OPT_CACHENOERRS
104 to suppress caching of any requests that result in an error, and
105 .B LDAP_CACHE_OPT_CACHEALLERRS
106 to enable caching of all requests.  The default behavior is to not
107 cache requests that result in errors, except that request that result
108 in the error
109 .B LDAP_SIZELIMIT_EXCEEDED
110 are cached.
111 .SH ERRORS
112 .B ldap_enable_cache()
113 returns 0 upon success, and -1 if it is unable to
114 allocate space for the cache.  All the other calls are declared as
115 void and return nothing.
116 .SH SEE ALSO
117 .BR ldap (3),
118 .BR ldap_search (3),
119 .BR ldap_compare (3)
120 .SH ACKNOWLEDGEMENTS
121 .B      OpenLDAP
122 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
123 .B      OpenLDAP
124 is derived from University of Michigan LDAP 3.3 Release.