Memoize IO actions