This can last for years. When you boil food you kill bacteria making it sterile. You also change the taste and nutritional value. Pasteurizing is used for liquids. This will kill some bacteria and stop some enzymes through heating.
Milk is the most commonly known product that is pateurized.
Juice and ice-cream are pasteurized also. It would take hour at 145 degrees or 15 seconds at 163 degrees to pasteurize milk. You need yeast for this method. This method takes carbon dioxide gas that has been dissolved under pressure. By taking out the oxygen, bacteria stops growing.