(CNN) Is coffee safe or risky for your heart? Two recent studies appear to contradict each other on this question, which often leaves coffee-lovers scratching their heads.

The study of more than 8,000 people across the United Kingdom also found that even those who drank up to 25 cups a day were no more likely to experience stiffening of the arteries than someone drinking less than a cup a day.

A cup of joe can come with some health benefits, as it contains antioxidants and has been associated with living longer , but some other studies suggest that overloading on coffee can put your heart health at risk.

Recent research found that heavy coffee consumption, measured as six cups per day, may be associated with a moderate increase in cardiovascular disease risk compared with the risk in those who drink less.

"In nutrition it is always expected that there is a threshold above which increasing intakes are no longer beneficial, and this is what we saw here," Elina Hypponen, study co-author and director of the Australian Centre for Precision Health at the University of South Australia Cancer Research Institute, wrote in an email.

"The best practice appears to be that of sticking to moderation," she said.

Photos: Coffee's health history Photos: Coffee's health history It's thumbs up today, but the news on coffee has not always been positive. Take a look at the arguments for and against coffee through the centuries. Hide Caption 1 of 15 Photos: Coffee's health history 1500s headline: Coffee makes you frisky – Legend has it that coffee was discovered by Kaldi, an Ethiopian goatherd, after he caught his suddenly frisky goats eating glossy green leaves and red berries and then tried it for himself. Hide Caption 2 of 15 Photos: Coffee's health history 1500s headline: Coffee leads to illegal sex – But it was the Arabs who started coffeehouses, and that's where coffee got its first black mark. Patrons of coffeehouses were said to be more likely to gamble and engage in "criminally unorthodox sexual situations," according to author Ralph Hattox Hide Caption 3 of 15 Photos: Coffee's health history 1600s headline: Coffee cures alcoholism – As the popularity of coffee grew and spread, the medical community began to extol its benefits. It was especially popular in England as a cure for alcoholism, one of the biggest medical problems of the time. Hide Caption 4 of 15 Photos: Coffee's health history 1600s headline: Coffee cures all? – This 1652 ad by London coffee shop owner Pasqua Rosée popularized coffee's healthy status, claiming that coffee could aid digestion, prevent and cure gout and scurvy, help coughs, headaches and stomachaches, and even prevent miscarriages. Hide Caption 5 of 15 Photos: Coffee's health history 1700s headline: Coffee helps you work longer – By 1730, tea had replaced coffee in London as the daily drink of choice. That preference continued in the colonies until 1773, when the famous Boston Tea Party made it unpatriotic to drink tea. Coffee houses popped up everywhere, and the marvelous stimulant qualities of the brew were said to contribute to the ability of the colonists to work longer hours. Hide Caption 6 of 15 Photos: Coffee's health history 1800s headline: Coffee shortage – In the mid-1800s, America was at war with itself, and one side effect was that coffee supplies ran short. Enter toasted grain-based beverage substitutes such as Kellogg's "Caramel Coffee" and C.W. Post's "Postum" (still manufactured), which advertised with anti-coffee tirades to boost sales. Hide Caption 7 of 15 Photos: Coffee's health history 1800s headline: Coffee will make you go blind – Postum's ads against coffee were especially negative, claiming that coffee was as bad as morphine, cocaine, nicotine or strychnine and could cause blindness. Hide Caption 8 of 15 Photos: Coffee's health history 1916 headline: Coffee stunts your growth –

Medical concerns and negative public beliefs about the benefits of coffee rose in the early 1900s. Good Housekeeping magazine wrote about how coffee stunts growth Hide Caption 9 of 15 Photos: Coffee's health history 1927 headline: Coffee will give you bad grades, kids – In a 1927 Science magazine article, 80,000 elementary and junior high kids were asked about their coffee drinking habits. Researchers found the "startling" fact that most of them drank more than a cup of coffee a day, which was compared with scholarship with mostly negative results. Hide Caption 10 of 15 Photos: Coffee's health history 1970s headline: Coffee is as serious as a heart attack –



And a In 1978, the same year Baseball Hall of Famer Joe DiMaggio began selling Mr. Coffee on TV, a New England Journal of Medicine study found a short-term rise in blood pressure after three cups of coffee.And a 1973 study found that drinking one to five cups of coffee a day increased risk of heart attacks by 60%, while drinking six or more cups a day doubled that risk to 120%. Hide Caption 11 of 15 Photos: Coffee's health history 2000 era headline: Time for meta-analysis –



But first, a couple of negatives: A



And a 2010 Now begins the era of the meta-analysis, in which researchers look at hundreds of studies and apply scientific principles to find those which do the best job of randomizing and controlling for compounding factors, such as smoking. The results for coffee: mostly good.But first, a couple of negatives: A 2001 study found a 20% increase in risk of urinary tract cancer for coffee drinkers but not tea drinkers. That finding was repeated in a 2015 meta-analysis . So if this is a risk factor in your family history, you might want to switch to tea.And a 2010 meta-analysis found a correlation between coffee consumption and lung disease, but the study found it impossible to completely eliminate the confounding effects of smoking. Hide Caption 12 of 15 Photos: Coffee's health history 2007-2013 headlines: Coffee reduces risk of stroke and some cancers –



This



As for prostate cancer, a meta-analysis of 11 studies on the link between stroke risk and coffee consumption between 1966 and 2011, with nearly a half a million participants, found no negative connection. And a 2012 meta-analysis of studies between 2001 and 2011 found four or more cups a day had a preventative effect on your risk for stroke.This meta-analysis showed that drinking two cups of black coffee a day could reduce the risk of liver cancer by 43%. Those findings were replicated in 2013 in two other studies. As for prostate cancer, a 2011 study followed nearly 59,000 men from 1986 to 2006 and found drinking coffee to be highly associated with lower risk for the lethal form of the disease. Hide Caption 13 of 15 Photos: Coffee's health history



And overall heart disease? A A similar analysis of studies on heart failure found four cups a day provided the lowest risk for heart failure, and you had to drink a whopping 10 cups a day to get a bad association.And overall heart disease? A meta-analysis of 36 studies with more than 1.2 million participants found that moderate coffee drinking seemed to be associated with a low risk for heart disease; plus, there wasn't a higher risk among those who drank more than five cups a day. Hide Caption 14 of 15 Photos: Coffee's health history 2015 headline: Coffee is practically a health food –



And as a sign of the times, in 2015, the How about coffee's effects on your overall risk of death? One 2013 analysis of 20 studies , and another that included 17 studies , both of which included more than a million people, found that drinking coffee reduced your total mortality risk slightly.And as a sign of the times, in 2015, the US Department of Agriculture agreed that "coffee can be incorporated into a healthy lifestyle," especially if you stay within three and five cups a day (a maximum of 400 milligrams of caffeine) and avoid fattening cream and sugar. You can read its analysis of data here. Hide Caption 15 of 15

The study, published in March in The American Journal of Clinical Nutrition , included health data on long-term coffee consumption and cardiovascular disease among 347,077 adults in the United Kingdom.

The data was collected in 22 centers between 2006 and 2010 as part of the UK Biobank . It featured self-reported information on how many cups of coffee the subjects drank each day, and the incidence of cardiovascular disease was measured.

Information on each adult's cardiovascular health came from hospital inpatient records and mortality records, Hypponen said in an email.

The subjects were grouped into seven categories: those who didn't drink coffee, those drinking decaffeinated coffee and those drinking caffeinated coffee. The latter group was further divided by how many cups they drank each day, on average.

The researchers found that, when compared with those who drank one or two cups a day, the odds of cardiovascular disease were 11% higher among adults who did not drink coffee, 7% higher among those who drank decaf and a whopping 22% higher among those who drank more than six cups per day.

"Readers may be surprised by the slight elevation in risk for those who did not drink any coffee or chose decaffeinated coffee," Hypponen noted.

"Coffee contains caffeine which is a stimulant. Caffeine administration in clinical trials has been shown to increase sympathetic nervous system activity and blood pressure, and in simple terms, excessive coffee intakes can make your heart work harder," Hypponen said.

"Anything that makes your heart work harder through that type of mechanisms, whether it would be stress or excessive coffee consumption, can be bad for your heart, especially if this continues over long periods of time," she said. "Some types of coffee which are produced without filtering also contain cafestol, which raises the blood LDL cholesterol and can affect cardiovascular disease risk through related mechanisms."

LDL is considered "bad" cholesterol , as high levels raise risk of heart disease and stroke.

The study had some limitations, including that the data on coffee consumption was self-reported and did not specify the size of the cup of coffee drunk. Additionally, the findings cannot be generalized outside the population of people who habitually drink coffee.

People also tend to self-regulate their coffee intake based on various factors, such as health concerns or pregnancy.

Overall, there has been a history of medical flip-flops on how coffee may affect your health , with some studies finding benefits and others warning of risks.

For instance, "one previous study shows that moderate but not heavy coffee consumption could have cardiovascular benefit," said Dr. Nieca Goldberg, a cardiologist and medical director of the Joan H. Tisch Center for Women's Health at NYU Langone Health in New York, who was not involved in the new study or the older one.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

Preliminary research presented at the American Heart Association's Scientific Sessions in 2017 suggested that coffee may be tied to reduced risk of heart failure and stroke. A 7% decreased risk of heart failure and 8% decreased risk of stroke was found to be associated with every increased cup of coffee consumed per week.

So "studies are all over the place," said Goldberg, a volunteer expert with the American Heart Association.

"My thoughts about coffee and increasing heart disease risk are, I think the data we have so far is not enough to tell people to stop drinking coffee," she said. "Coffee is probably safe as long as you're not a heavy drinker."