[minor] Allow a custom cache to be used.