Fix logic when the cache is changed after startup