A DirectoryCache caches entries on read, but should also do negative caching on missing entries.
Usually a read on a missing entry is rarely, if ever, attempted, but in the particular case of the groupDirectory it happens a lot due to the fact that internally in Nuxeo user ids and group ids are often stored in the same field (for instance in ACLs), and therefore both the groupDirectory and the userDirectory have to be consulted before finding if a given id refers to a group or a user.
With this improvement, to activate the negative caching, use a contribution like:
<require>...</require> <extension target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory" point="directories"> <directory name="groupDirectory"> <negativeCaching>true</negativeCaching> </directory> </extension>
This improvement also adds two new metrics on directories:
- nuxeo.directories.yourDirectoryName.cache.neghits: the number of hits on the negative cache, if activated.
- nuxeo.directories.yourDirectoryName.cache.misses: the number of cache misses.