I don't think it effects this year's cap.
I think they just need to have the average salary of the contract there for next year.
I'll go check.
Here is what NHLCBA.com says
Player contracts will not be renegotiated (upward or downward) during their term. Extensions may be negotiated but only in the final year of the contract and only if such extension is for an amount that can be accommodated in a Club's upper limit for the current year or as computed for future years.
Yes it is excessive. But with the lack of quality goaltenders in the league he would have easily got that on the open market next season. This is probably the only way they could keep him. In reference to the cap issue.....you are correct. When a play signs a contract extension the "new" average of the entire contract becomes the players new cap hit. So his new cap hit would be $5.19M/year.
$3.162 million = this season's salary
$22.8 million = contract extension
$25.962 million total salary divided by 5 seasons