As the Vikings approached free agency this past offseason, the message from head coach Mike Zimmer was clear: It’s fine to aim for a home run at quarterback as long as it doesn’t mess with the defense.

The Vikings did, indeed, spend big on a QB by landing Kirk Cousins at $28 million per season guaranteed for three years. Any of their internal options — Sam Bradford, Case Keenum or Teddy Bridgewater — would have been significantly cheaper but also carried more risks.

With the season set to kick off Sunday against San Francisco, an evaluation of their salary cap indicates the Vikings have threaded the needle — at least for now — by upgrading with more stability at quarterback while also still committing heavily to their defense.

That shows up in their spending habits like this:

• Per spotrac.com, six of their eight most expensive players this year in terms of cap hits — six of the seven after Cousins, their highest-paid player — are defensive players: Xavier Rhodes, Anthony Barr, Everson Griffen, Harrison Smith, Linval Joseph and Sheldon Richardson.

• While the Vikings aren’t close to being the biggest defensive spenders this year in the NFL — that honor goes to Jacksonville, which has a whopping $122.5 million in cap space devoted to defensive linemen, linebackers and defensive backs — they are far and away the biggest defensive spenders in the NFC North.

The Vikings have $101.1 million in cap space — more than half — committed to the defense this year. Green Bay, Chicago and Detroit are all between $72 million and $75 million in defensive spending this year, and all three spend far more on offense than defense.

Now, some of that just reflects where players are in their careers. The Vikings have drafted heavily on defense since Zimmer’s arrival, while he also inherited stars such as Smith and Rhodes. A lot of those players are done with their less expensive rookie deals and have cashed in with lucrative extensions. But it also shows a commitment to defense.

This could shift to a degree in coming years as Stefon Diggs’ extension kicks in and other offensive players like Adam Thielen are due raises. That could force some tough decisions for the Vikings — or at the very least stretch the “two-tiered” approach General Manager Rick Spielman has talked about when it comes to salaries and roster building.

Having players worthy of lucrative extensions is a good problem to have since it indicates drafted players have panned out, but it also creates a scenario where creativity is required to keep core players happy and a strong roster intact.

The Vikings deserve credit for smart cap management to-date. This season, for instance, they’re spending the fourth-most on active players in the NFL and have fourth-lowest amount of “dead cap” money — cap space being used on players no longer on the roster. That indicates prudent decisions.

The task for Spielman (and even more for Vikings cap whiz Rob Brzezinski) will grow and determine whether the Vikings’ championship window is open for a few years or if they can maintain the “wide-open spaces” Zimmer talked about before free agency even began.