A few weeks ago, with covid-19 cases plunging, it seemed as if the pandemic might soon be effectively over. Not anymore.

With the highly contagious delta variant spreading, The Post reports that daily covid-19 cases rose 54.2 percent in the past week, daily deaths rose 36.1 percent and coronavirus-related hospitalizations rose 42.2 percent. In many places in the South, where vaccination rates are low, hospitals are once again filling up. Even those who have been vaccinated may be able to spread the virus. As a result, the Centers for Disease Control and Prevention just recommended that everyone should resume wearing masks indoors in high-transmission areas.

This is a serious nuisance — particularly to those of us who are already vaccinated. We’ve done our part. If everyone else had been equally responsible, we wouldn’t be in this pickle right now. Unfortunately, a third of adults still haven’t gotten a single shot. So here we are. Thanks, unvaccinated people, for the mess you’ve made.

Nevertheless I remain fundamentally optimistic — and not just because the mysterious fall in delta cases in India and Britain suggests we may soon see a similar decline. There are two other big reasons to be of good cheer right now.

First, vaccines remain very effective even against the delta variant. Malevolent know-nothings like Tucker Carlson are trying to discredit vaccines because of the small number of infections in those who are fully vaccinated. But the real story is how few vaccinated people are getting seriously sick.

A cluster of “breakthrough” cases in Provincetown, Mass., has gotten a lot of attention. Yet its town manager reports: “Of the 900 cases related to the Provincetown cluster, there have been no deaths, 7 hospitalizations, and the symptoms are largely mild.” Overall, Axios reports, of the 164 million Americans who have been vaccinated, only 0.077 percent have been infected, 0.004 percent have been hospitalized, and 0.001 percent have died. More than 99 percent of coronavirus deaths are occurring among unvaccinated people. So deaths should be much lower than during earlier coronavirus waves.

The second reason I’m optimistic is that we may finally be reaching a tipping point with vaccine mandates. Government and private-sector leaders are finally realizing that reckless people will not listen to reason. In recent days we’ve seen vaccine requirements of various sorts from California, the nation’s largest state, and New York City, the largest city. President Biden has required proof of vaccination (or a negative coronavirus test) from federal workers. Walmart, the nation’s largest private employer, has joined the trend, along with Uber, Google, Facebook, Walt Disney, The Post and many other companies.

The vaccine mandates still don’t go nearly far enough. Biden should mandate that all military personnel be inoculated. The Federal Aviation Administration should mandate that all airline passengers show proof of vaccination. Walmart should mandate vaccination not just for headquarters workers but for all employees and customers.

Proof of vaccination (or a recent coronavirus test) should be mandatory for entrance into all indoor gathering spaces. Such a step would be opposed by some unions and many Republican politicians, but it would be broadly popular. Nearly two-thirds of Americans in one recent poll backed a universal vaccination mandate — an even more sweeping requirement.

Some analysts warn that mandates will backfire and simply raise vaccine resistance. Maybe, but I doubt it. Vaccine requirements have been working in Europe, which has just overtaken the United States in the share of the population that is vaccinated. They also work in the United States when it comes to childhood vaccinations, which are mandatory for students. That’s why we no longer have to worry about diseases such as polio or measles.

Other mandatory public safety measures, such as “no smoking indoors” and “wear a seat belt,” also achieve high rates of compliance, thereby saving hundreds of thousands of lives. Even mask mandates are generally followed — particularly on flights where you can be kicked off for not wearing one. Why should coronavirus vaccine mandates be any different? Indeed, because of the news about the delta variant and vaccine mandates, there was a spike in vaccinations on Friday, with the most shots administered since July 3.

A Kaiser Family Foundation survey in June found that of those who are taking a “wait and see” attitude, 40 percent would get their shots if required to do so to fly or attend large gatherings — much higher than the number who would be swayed by $100 cash. Only about 10 percent of the larger group of hardcore anti-vaxxers (who are overwhelmingly White and Republican) say they would be swayed by such requirements. But I bet even many of them would grudgingly comply if vaccinations were needed to fly, shop or work.

Mask mandates may still be necessary, but they are only a short-term expedient. The long-term answer is vaccination. The sooner we get more people vaccinated, the sooner we can return to normal life. So the efficacy of vaccines and the spread of vaccine mandates offer reasons for hope even amid the delta gloom.