The Bluebirds, who made it four unbeaten on the road, benefited from some generous defending to score three times in 11 minutes before the break at the AESSEAL New York Stadium.
Bruno Ecuele Manga, Federico Macheda and Conor McAleny did the damage before Rotherham’s improved showing after the break saw them grab a late consolation through Danny Ward.
The win leaves Russell Slade’s men stuck in mid-table with no chance of going up or down this season.
The Millers would love to be in such a position of comfort as defeat leaves them entrenched in a relegation battle, though their disappointment was softened by Millwall’s defeat at Middlesbrough, meaning they remain six points above the drop zone after a first home loss in five.
On the back of a vital win against Millwall on Saturday, the Millers came into the game with lifted spirits and they started the better, with Matt Derbyshire having a goal ruled out for offside in the 10th minute.
But the Bluebirds sprang into life and stunned their hosts with two goals in two minutes with their first efforts on goal.
The first came in the 24th minute when Manga was left unmarked at a corner and he powered home a header from six yards out.
And with their next attack, Macheda sweetly volleyed home from over his shoulder after a ball back into the area from Matthew Connelly, though there were fruitless appeals for offside from a ragged Rotherham defence.
The visitors were then gifted a decisive third by some more slapdash defending in the 35th minute, as after two failed clearances McAleney was allowed the freedom of the area to slam home.
Cardiff were forced to change goalkeepers at the interval, with Simon Moore coming on for David Marshall, but such was the Millers’ lack of cutting edge they failed to even force him into a save until the 76th minute.
Instead it was the Bluebirds who looked the likeliest to add to their lead, with home goalkeeper Adam Collin producing a fine double save to deny Aron Gunnarsson and then Alex Revell.
Moore finally got his hands warm 14 minutes from time when he palmed away Adam Hamill’s wicked drive, with Manga clearing the rebound off the line.
The Millers finally had something to cheer when Ward headed home Hammill’s cross five minutes later but there was no great comeback.