Cache: more efficient detection for existing entries during upgrade