Add caching of list_refs.