OAKLAND, Calif. — Almost 3,000 miles away from Yankee Stadium the Yankees opened a nine-game West Coast trip Tuesday night that could determine whether they will have home-field advantage throughout the postseason.

Three games in the dilapidated Coliseum against the A’s, who started Tuesday evening’s action one game out of the second AL wild-card spot held by the Rays and 2½ back of the Indians who entered the night with the top position, are followed by three weekend games at Dodger Stadium and three in Seattle.

Like the Yankees in the AL East, the Dodgers are rolling toward clinching the NL West since they were a whopping 18 ½ games ahead of the second-place Giants going into Tuesday night’s schedule.

With a 10-game lead over the Rays in the AL East, the Yankees, who had the best record in the majors at 83-43 as play began, are overwhelming favorites to win the division for the first time since 2012. Going into Tuesday night’s game, the Yankees’ magic number over the Rays to clinch the title was 27. Any combination of Yankees’ wins and Rays’ losses equaling 27 will leave the Rays battling for a wild-card ticket into October.

Not only do the 71-53 A’s and 82-44 Dodgers present formidable challenges, the Yankees are very into resting players. So how do Aaron Boone and the medical staff juggle chasing home-field advantage against not dragging a tired team into October?

The Yankees take resting players very seriously no matter the name. This past Saturday in the third of four games against the Indians, a team the Yankees could see in October, Boone didn’t start Gary Sanchez or Aaron Judge. And when Brett Gardner was ejected, Mike Tauchman shifted from left to center and Thairo Estrada, who had played two big-league games in left, moved from second base to right. Judge stayed in the dugout.

“It’s similar to how I do it through the year,” Boone said. “You try to strike a balance, make sure you take care of guys, make sure the bullpen’s taken care of. We have a club that allows us to give guys days.”

The rosters increasing Sept. 1 will help. So, too, should getting Dellin Betances, Luis Severino, Luke Voit, Aaron Hicks and Giancarlo Stanton back from the injured list, which isn’t a given. And if they do make it back who gets pushed aside? Can Boone choreograph their re-entry into the big leagues while attempting to win games? How limited will the returnees be?

Whatever the answers are, Judge said the goal remains the same.

“We want to keep winning, that’s big,’’ Judge said after the Yankees completed a 6-2 homestand Sunday. “We know how rowdy this place gets in the postseason and how crazy these fans are. We have to keep winning to make sure we keep that home-field advantage for the postseason.’’

When a team has the best record in the big leagues, it has played well at home and on the road. The Yankees’ 49-20 (.710) record in the Bronx was second only to the Dodgers’ 48-16 (.750) at Dodger Stadium.

And while Yankee Stadium’s dimensions in right field favor hitters and the Yankees led the majors with 118 homers at home, they also hit 109 (fifth) on the road.