update local cache logic