Re: Problems with LIBLDAP's caching

Mark Smith (mcs@netscape.com)
Tue, 13 Aug 1996 15:34:38 -0700

Nils Andreas Thommesen wrote:
>
> I have made a LDAP client running on Microsoft Windows 3.x.
> I (still) use LDAP v.3.2. (in LIBLDAP.DLL).
>
> My problem is that caching doesn't seem to work at all.
> If I do a query into some organization and then repeat the same query
> immediately afterwards, LIBLDAP still contacts the server instead of
> looking up the cache.
>
> I set the cache options like this:
> ...
> int result = ldap_enable_cache( m_current_ld, 10000 , 1000 );
> ...
>
> I thought the statements above set the cache timeout to 10000 seconds
> (which by the way should be a large value....)
> ...

The third argument to ldap_enable_cache() is the maximum number of bytes
to use for cached information. Try passing something larger than 1000
(or pass zero if you want the cache to be limited by the timeout value
only). This is fairly well documented in the man page, which can be
found here:

http://www.umich.edu/yp-cgi-bin/ldapman?3+ldap_enable_cache#sect2

and in the U-M LDAP source distributions.

-Mark