The attribute cache has the advantage of being able to resolve filters in memory rather than in the database. It also has the advantage of being updated each time an LDAP add, delete, modify, or modrdn operation is performed.
In deciding which attributes you want to store in memory, you need to consider:
Not all attributes can be added to the attribute cache. To determine whether or not an attribute can be added to the cache, use the ldapexop command:
Attribute caching can be configured two ways: manually or automatically. To manually configure attribute caching, the administrator should perform cn=monitor searches to understand how to make attribute caching most effective. These searches return current information listing which attributes are cached, the amount of memory used by each attribute cache, the total amount of memory used by attribute caching, the amount of memory configured for attribute caching, and a list of the attributes most often used in search filters. Using this information, an administrator can change the amount of memory that is allowed to be used for attribute caching, as well as which attributes to cache whenever necessary based on new cn=monitor searches.
Alternatively, an administrator can configure automatic attribute caching. When automatic attribute caching is enabled, the Directory Server tracks the combination of attributes that would be most useful to cache within the memory limits defined by the administrator. It then updates the attribute caching at a time and time interval configured by the administrator.