This document describes an automatic query caching system called Exchequer. Exchequer caches both final and intermediate results of queries to improve query response times. It uses a directed acyclic graph (DAG) representation of queries and cached results. The optimizer is tightly coupled with the cache manager to make mutually consistent decisions about query execution plans and cache management plans. Experimental results show that Exchequer improves query response times by more than 30% compared to previous caching systems and can achieve the same response times with only one tenth of the cache size.