A framework for answering Lightweight Directory Access Protocol (LDAP) queries
from previously cached queries includes a proxy server configured to receive client
directory queries. The proxy server maintains a cache of data (entries) and semantic
information associated with a query. In response to a query received from client,
the proxy invokes a query containment procedure which uses the semantics of the
incoming and stored queries to determine whether the query can be answered from
cached queries. The proxy answers queries from the local cache when possible, and
for other queries it sends the request to a directory server. The semantics of
the new query and the resulting data (entries) are added to the cache. The method
and apparatus can be used for positive conjunctive queries for answering equality,
range and substring queries.