(CNN) It's one of the age-old medical flip-flops: First coffee's good for you, then it's not, then it is -- you get the picture.
A massive review of the scientific literature on coffee published in the British Medical Journal found that drinking three to fours cups of black coffee a day provides the most health benefits overall. Prior studies have found similar benefits reducing risk for such issues as melanoma, heart disease, multiple sclerosis, type 2 diabetes, liver disease, prostate cancer, Alzheimer's, computer-related back pain and more.
But the study also found two areas of concern. High levels of coffee consumption (more than four cups) during pregnancy was associated with low birth weight, pre-term birth and stillbirths. For women with a higher likelihood of bone fractures, coffee raised that risk; the same was not true for men.
Prior research also suggests people with sleep issues or uncontrolled diabetes should check with a doctor before adding caffeine to their diets.
To stay completely healthy with your coffee consumption, you'll want to avoid packing it with calorie-laden creams, sugars and flavors. And be aware that a cup of coffee in these studies is only 8 ounces; the standard "grande" cup at the coffee shop is double that at 16 ounces.
How you brew it also has health consequences. Unlike filter coffee makers, a French press, Turkish coffee or the boiled coffee popular in Scandinavian countries fails to catch a compound called cafestol in the oily part of coffee that can increase your bad cholesterol or LDL.
As you know, the news on coffee has not always been positive; in fact, the argument over the merits of your daily cup of joe dates back centuries. Let's take a look at the timeline.
1500s headline: Coffee leads to illegal sex
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. But it was the Arabs who first 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. By 1511, the mayor of Mecca shut them down. He cited medical and religious reasons, saying coffee was an intoxicant and thus prohibited by Islamic law, even though scholars like Mark Pendergrast believe it was more likely a reaction to the unpopular comments about his leadership. The ban didn't last long, Pendergrast says, adding that coffee became so important in Turkey that "a lack of sufficient coffee provided grounds for a woman to seek a divorce."
1600s headline: Coffee cures alcoholism but causes impotence
As the popularity of coffee grew and spread across the continent, 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; after all, water wasn't always safe to drink, so most men, women and even children drank the hard stuff.
Local ads in 1652 by coffee shop owner Pasqua Rosée popularized coffee's healthy status, claiming that it could aid digestion, prevent and cure gout and scurvy, help coughs, headaches and stomachaches, even prevent miscarriages.
But in London, women were concerned that their men were becoming impotent, and in 1674 The Women's Petition Against Coffee asked for the closing of all coffeehouses, saying in part: "We find of late a very sensible Decay of that true Old English Vigour. ... Never did Men wear greater Breeches, or carry less in them."
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. Coffeehouses 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.
1800s headline: Coffee will make you go blind. Have a cup of hot wheat-bran drink instead
In the mid-1800s, America was at war with itself, and one side effect is 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). They advertised with anti-coffee tirades to boost sales. C.W. Post's ads were especially vicious, Pendergrast says, claiming coffee was as bad as morphine, cocaine, nicotine or strychnine and could cause blindness.
1916 headline: Coffee stunts your growth
While inventions and improvements in coffee pots, filters and processing advanced at a quick pace throughout the 1900s, so did medical concerns and negative public beliefs about the benefits of coffee.
Good Housekeeping magazine wrote about how coffee stunts growth. And concerns continued to grow about coffee's impact on common aliments of the era, such as nervousness, heart palpitations, indigestion and insomnia.
1927 headline: Coffee will give you bad grades, kids
In Science Magazine, on September 2, 1927, 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 then compared with scholarship, with mostly negative results.
1970s and '80s headline: Coffee is as serious as a heart attack
A 1973 study in the New England Journal of Medicine of more than 12,000 patients found 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%.
Another New England Journal of Medicine study, in 1978, found a short-term rise in blood pressure after three cups of coffee. Authors called for further research into caffeine and hypertension.
A 38-year study by the Johns Hopkins Medical School of more than a 1,000 medical students found in 1985 that those who drank five or more cups of coffee a day were 2.8 times as likely to develop heart problems compared with those who don't consume coffee. But the study asked questions only every five years and didn't isolate smoking behavior or many other negative behaviors that tend to go along with coffee, such as doughnuts. Or "doooonuts," if you're Homer Simpson.
Millennium headline: Coffee goes meta
Now begins the era of the meta-analysis, where researchers look at hundreds of studies and apply scientific principles to find those that do the best job of randomizing and controlling for compounding factors, such as smoking, obesity, lack of exercise and many other lifestyles issues. That means a specific study, which may or may not meet certain standards, can't "tip the balance" one way or another. We take a look at some of the years. The results for coffee? Mostly good.
2001 headline: Coffee increases risk of urinary tract cancer
But first, a negative: A 2001 study found a 20% increase in the risk of urinary tract cancer risk 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.
2007 headline: Coffee decreases risk of liver cancer
Some of these data analyses found preventive benefits for cancer from drinking coffee; one 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.
2010 headline: Coffee and lung disease go together like coffee and smoking
A 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.
2011 headline: Coffee reduces risk of stroke and 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. In fact, there was a small benefit in moderate consumption, which is considered to be three to five cups of black coffee a day. Another meta-analysis of studies between 2001 and 2011 found that four or more cups a day had a preventive effect on the risk of stroke.
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.
2012 headline: Coffee lowers risk of heart failure
More meta-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.
2013 headline: Coffee lowers risk of heart disease and helps you live longer
For general 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 of heart disease; plus, there wasn't a higher risk among those who drank more than five cups a day.
How about coffee's effects on your overall risk of death? One 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.
2015 headline: Coffee is practically a health food
As a sign of the times, the US Department of Agriculture now agrees that "coffee can be incorporated into a healthy lifestyle," especially if you stay within three to five cups a day (a maximum of 400 milligrams of caffeine), and avoid fattening cream and sugar.
2017 headline: Drink up unless you are pregnant, at risk for fractures or have Parkinson's
A massive study on coffee and mortality surveyed 520,000 people in 10 European countries and found that regularly drinking coffee could significantly lower the risk of death. Another study with a focus on non-white populations said coffee's impact on longevity doesn't have to do with how it's prepared or how people drink it; it has to do with the beverage's biological effect on the body.
On the cautionary side, a study published in September reversed opinion on the benefits for Parkinson's disease, which was long thought to be helped by caffeine. Researchers who first that found coffee reduced tremors in those with Parkinson's went back and studied a larger sample of patients for a longer time. This time, they found no difference between those taking caffeine tablets and those taking a placebo. After the initial data came back negative, the study was stopped.
In November, the British Medical Journal published a huge umbrella study that looked at over 200 meta-analyses of the health benefits of coffee and that found three to four cups of coffee a day lowers the risk of heart disease, numerous types of cancer, and neurological, metabolic and liver disorders, as well as overall mortality.
High levels of coffee consumption (over four cups a day) was associated with a higher risk of fractures in women who already had a greater likelihood, but not in men.
Pregnant women should also be wary. Higher levels of coffee consumption were found to increase risk for preterm births and stillbirths, as well as low birth weight in babies. This is possibly due to the fact that the half-life of caffeine is known to double during pregnancy, raising the dose of caffeine per cup, according to the study.
2018 headline: Coffee could come with a warning in California
California coffee shops may soon be forced to warn customers about a possible cancer risk. A lawsuit against several coffee makers and sellers alleges that they "failed to provide clear and reasonable warning" that drinking coffee could expose people to acrylamide. The chemical is created when coffee beans are roasted. California keeps a list of chemicals it considers possible causes of cancer. Acrylamide is on that list. The coffee industry argued before a judge that the level of acrylamide in coffee should be considered safe and that the health benefits of coffee essentially outweigh the risk. A decision by the judge is pending.
Regardless of that ruling, there's sure to be another meta-study, and another opinion. We'll keep you updated.