add cache_query controller method, add update_cached_queries callback