The query cache is implemented as a map of key/value pairs. Each entry in the map represents a single query and the associated response. For an individual cache entry, the query XML is the map key, and the response XML is the map value.

When a user enters a query (either through free-text search or by clicking a facet value), Routing checks the cache to see if it has a key that matches the query. If it finds a match, it uses the map value corresponding to the key as the search response. In this case, the query is not sent to the search engine.

If no match is found, the query is directed to the search engine, and a response is returned. The query and the response are then used to construct a new entry in the cache.

Search caching is implemented through the atg.service.cache.persistent.ehcache.EHCacheService class, which invokes the Ehcache open source library. For more information about the EHCacheService class, see the ATG Platform API Reference. For information about the Ehcache library, see http://ehcache.sourceforge.net/.