If you’ve visited your local Costco, CVS, Walgreens, or other stores recently, you might have noticed advertisements for this year's flu vaccines.

Is it a good idea to get the shot now, before flu arrives? Or will that undermine its effectiveness in January and February, when flu season is in full swing?

The Centers for Disease Control and Prevention recommend that most people get vaccinated as soon as the shot becomes available (which can be as early as late July). That way, you’ll be protected when flu season typically starts around mid-October, and when it peaks from December through February. 

Early vaccination is an especially good idea for children six months to 8 years old because, unlike the rest of us, they need two doses of the flu vaccine given 28 days apart, says William Schaffner, M.D., a professor of medicine at Vanderbilt University School of Medicine and a consultant to the CDC’s Advisory Committee on Immunization Practices. So if they get their first shot in early September and their second in early October, they’ll likely be protected by the time the flu arrives.

On the the other hand, two groups of people might benefit from waiting a little bit before getting the shot: people 60 and older and those who have a compromised immune system due to conditions such as autoimmune disease, HIV, or those undergoing chemotherapy treatment.

That’s because in those people, research suggests there’s about a four-month window after getting the vaccine when the body is best able to fight the virus. 

After that, for at least some people in those groups, the immune system’s virus-fighting ability begins to wane.

Schaffner emphasizes that this evidence is not definitive, and that even with declining protection the flu vaccine still seems to provide some protection after four months. Still, he says, people who are older or have underlying chronic diseases might want to wait until late September or early October to be sure that their protection will cover the entire influenza season, which can extend into March, or even dribble into early April.

It doesn't matter whether you get the flu vaccine from your primary care doctor or your local pharmacy, Schaffner says. They’re both perfectly safe places to get it. The most important thing is that you get it.