Add query caching