Caching queries and responses can significantly improve performance, but the disadvantage is that the cache may use a lot of memory or disk space, since each cache entry includes a complete request and response.
Oracle ATG Web Commerce Search provides mechanisms for compressing cached requests and responses to reduce disk and memory usage. The mechanisms for compressing requests and responses are separate, because the objectives are different:
A lossless compression scheme must be used for the responses, so they can be reconstructed exactly. When a response is retrieved, the compressed value is decompressed to obtain the original value.
The size of a request can be reduced to a much greater degree by using a one-way hash function. When a new query is issued, Routing compares the hash value of the new request with the stored hash values in the cache. It is not necessary (or possible) to recover the original request.