Town came from behind to seal a crucial and thoroughly deserved win over Charlton Athletic at The Valley in front of the Sky Sports cameras.
Danny Wilson's side started on the front foot, forcing a series of early corners, but the hosts soon settled and began to look equally dangerous going forward.
After an engaging but uneventful opening 20 minutes, Town found themselves behind, and had reason to be aggrieved at doing so.
Addicks striker Paul Benson looked to have used an arm to control the ball in the build up, but the referee allowed play to continue, and after Kyel Reid's cross was cleared by Andy Frampton, the loose ball dropped to Johnnie Jackson, whose pot shot at goal took a wicked deflection off the defender and looped over the helpless Phil Smith into the net.
It was cruel on the visitors who had started the game strongly, and although they reacted well, clear cut chances were still few and far between.
Ritchie went close to levelling the scores with a 25-yard curler which Rob Elliot did well to tip over the bar on 38 minutes, and Charlie Austin will have been disappointed to have not connected cleanly with a Michael Rose cross minutes later.
However, Town found themselves back on terms with three first half minutes remaining, and it was no less than they deserved.
More patient build up ended with Michael Timlin lifting a cross into the area which Ritchie stole in to volley goalwards, and though Elliot was equal to the initial effort, the loose ball rebounded back into Ritchie's path, and he made no mistake from two yards out.
The visitors finished the half on top, and will have taken much heart into the break after dominating for long periods.
The Addicks started the second half in control of possession but failed to seriously test Phil Smith, and it was Town who found themselves in front after 56 minutes through Charlie Austin's 16th goal of the season.
Alan O'Brien had nodded the ball hopefully forward and though Christian Dailly reached it first, he dwelt for too long, and Austin pounced to snatch the ball from him and drill the ball into the corner with his left foot from just inside the box.
Charlton huffed and puffed in response, but were looking increasingly desperate in attack as their supporters grew more impatient.
Town's evening got ever better on 77 minutes when Jon-Paul McGovern fired a deep free-kick into the box and fellow substitute Sean Morrison rose highest to bullet a header into the top corner and send Town's away following into raptures.
And it was four moments later, as Caddis sent a looping volley into the six-yard box and Austin reacted quickest to head the ball home for his second of the night.
The hosts did pull a goal back with three minutes to go, as Jose Semedo's ball into the box was hooked expertly into the far corner by Pawel Abbott, but it was far too little far too late for the Addicks, who were snuffed out by an impressive all-round Town performance.