Memoize function call to disk