0 of 0

Buy a jug of milk in the U.S. and, as long as it's in the fridge, you shouldn't have to worry about it spoiling for about three weeks.

That's quite a luxury. Because it's not the case in many other parts of the world where fresh milk has a much shorter shelf life.

Milk is highly perishable — a few hours out of the cow at room temperature, and bacteria, some of which cause disease, start to flourish.

In places like Uganda, milk typically lasts just one day. The cow gets milked, and farmers, most of whom have just a few cows, rush to get the milk directly to the consumer. If it doesn't arrive in time, it will probably go to waste.

Why? Because three-quarters of Ugandan dairy producers don't have a way to pasteurize the milk or keep it cool. The same goes for other African countries, such as Ethiopia and Zambia.

But short shelf life isn't just a problem in Africa. Fresh milk in Brazil lasts only three to eight days — depending on the availability of refrigeration.

Unlike Uganda, fresh milk in Brazil typically undergoes pasteurization, a heat process that kills off bacteria to make milk last longer. (Editor's note: As several commenters have noted, ultra-pasteurized milk in unrefrigerated cartons is another product available in Brazil and other countries. Its shelf life can be several months.)

But after it leaves the farm, it is often exposed to heat on its way to the consumer, which cuts into the shelf life.

So what does the U.S. (and other developed nations) have that these countries don't? A complex system to keep milk cold, says William Kisaalita, an engineer at the University of Georgia. It's called the cold chain, and it's a series of refrigerated tanks, trucks and storage units that milk — and other foods — travel through from farmer to distributor to consumer.

"Many people [in Uganda] don't have the means to cool milk," says Kisaalita, who was born there. "Farmers [who produce milk] make $5 a day. That's not enough to invest in a fridge, and if they did have one, there's no electricity ... the cost here is so high for electricity."

The problem peaks during the rainy season when cows are producing more milk. During that season, Kisaalita estimates, Ugandan farmers lose up to half of their milk (and profits) to spoilage.

Indeed, the Food and Agriculture Organization of the United Nations found that 27 percent of all milk produced in Uganda is poured down the drain each year. That's equivalent to $23 million worth of profits.

According to Scott Rankin, a food scientist at the University of Wisconsin, Madison, limited or nonexistent electricity is one of the main reasons the cold chain isn't as reliable in many developing countries. But refrigerators also require a big investment that many farmers can't afford.

Despite the challenges, people are experimenting with all different ways to extend the life of milk under these circumstances. For instance, in Brazil, a company recently doubled the shelf life there — from seven to 15 days — by applying nanotechnology to plastic milk jug packaging.

To help Uganda's milk producers, Kisaalita is working on a device to keep milk cool. The cooler runs on biogas, not electricity, so farmers simply have to collect cow dung to get the machine working. Kisaalita is currently testing the system with Ugandan farmers, and if it pans out, milk could be stored overnight and sold fresh the next day.

Struggling milk producers can also form co-ops to share expenses and invest in refrigeration and a means to adequately process and transport milk. This method has been quite successful for small producers in India; the country is currently considered the world's largest milk producer.

These efforts won't just save money from going to waste. By making milk last longer, more people could get their hands on a nutrient-rich food. Milk contains important nutrients like calcium and magnesium — especially important in developing countries where many suffer from malnutrition.

But even with the three-week shelf life in the U.S. — all thanks to a superb cold chain and pasteurization process — plenty of milk goes to waste here.

Dairy is one of the top three foods wasted in the U.S., and some 17 billion pounds of milk, or 32 percent of the total supply, is lost a year, according to 2010 U.S. Department of Agriculture data.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.