Only set it up when a cache is configured.