Not sure if there's been an article about that question yet, but yes, it appears to have been a long long time, and I think the last time it happened in the regular season a few of the Huskies might not have been born yet.
From the record books, it appears the last time UConn had a home game against a #1 team it was with Baylor on 2/18/2013, but that was at the XLS in Hartford and was a loss.
And last game at Gampel against the #1 appears to go back to Bird at the Buzzer, 0n 3/06/2001 in the 78-76 BET championship game win over Notre Dame.
And it appears that the last time a #1 team came into Gampel during the regular season before a conference championship goes back to the first meeting with UTenn on 1/16/1995 with a 77-66 Uconn win.
Now it's still a ways to the game with USCar and they may not be #1 then, but if it does happen, yes it will have been a very long time.