Initial work on query caching