Files
freeipa/ipaserver/plugins
Rob Crittenden a4675f6f50 Implement simple LDAP cache layer
Insert a class before LDAPClient to cache the return value
of get_entry() and certain exceptions (NotFound and
EmptyResult). The cache uses an OrderedDict for the cases
where a large cache might result an LRU model can be used.

The cache be enabled (default) or disabled using
ldap_cache=True/False.

This cache is per-request so is not expected to grow
particularly large except in the case of a large batch
command.

The key to the cache entry is the dn of the object
being requested.

Any write to or referencing a cached dn is evicted from
the cache.

The set of attributes is somewhat taken into consideration.
"*" does not always match everything being asked for by
a plugin so unless the requested set of attributes is a
direct subset of what is cached it will be re-fetched. Err
on the side of safety.

Despite this rather conserative approach to caching 29%
of queries are saved with ipatests/xmlrpc_tests/*

https://pagure.io/freeipa/issue/8798

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
2021-05-12 10:45:57 -04:00
..
2010-12-20 17:19:53 -05:00
2017-03-27 19:08:26 +02:00
2020-07-07 10:07:48 -04:00
2018-01-09 07:53:28 +01:00
2019-10-21 18:01:32 +11:00
2019-03-28 00:21:00 +01:00
2020-03-31 09:21:37 +03:00
2020-09-23 14:49:15 +02:00
2021-05-12 10:45:57 -04:00
2018-01-09 07:53:28 +01:00
2021-03-30 09:58:42 +02:00
2020-05-05 10:42:46 +02:00
2019-03-28 00:21:00 +01:00