Drinking coffee could help you live longer, and not by just a little bit.

A new study by researchers at the National Cancer Institute has found that drinking up to eight cups a day is associated with a reduced risk of early death. But there is other news that contradicts this finding. For example, the state of California just declared coffee a carcinogen a few months ago.

So how does coffee really affect our health?

“Like a number of prior studies, we observed that coffee drinking was associated with a lower risk of mortality during the 10-year study period,” said Erikka Loftfield, a research fellow at the National Cancer Institute.

Other studies have looked at whether coffee lengthens or shortens life, but this is the first study that looked at how fast people metabolize coffee to see if that made any difference.

Not only did it not matter whether people were fast or slow at metabolizing caffeine, it didn't even matter if the coffee had caffeine in it.

“Decaf coffee seemed to also have this effect of reducing the risk of early death,” Loftfield said.

There are over 1,000 compounds in coffee, and caffeine is only one of those. So it’s going to take more research to pin down what these potential mechanisms might be, Loftfield said.

Statistics from UK Biobank allowed researchers to look at 10 years of data from 500,000 people. They were able to see that one cup of coffee per day was linked to an eight percent drop in the risk of death.

“And then for people drinking eight or more cups per day, we saw a 14 percent lower risk of mortality during the 10-year period,” Loftfield said.

The study did not look at cancer risk and coffee consumption, but it it did look at the number of people who died of cancer.

“We similarly saw that there was a lower risk of death from any cancer," Loftfield said. "For those who are drinking coffee, the California ruling is related to acrylamide, which is a compound in coffee that results from roasting.”

For her part, Loftfield drinks a couple of cups of coffee a day. She takes her cue from the 2015 Dietary Guidelines for Americans, which included the recommendation that moderate coffee drinking —
about three to five cups per day — could be a part of a healthy diet.