Merge "Ensure the generation is not changed before put value to cache"