#199 add cache function; some doco