Both Miliband and Cameron must bet the house on Rochester to save themselves now

Ukip's victory in the Clacton by-election was historic, if not unpredictable. From the moment Douglas Carswell entered the room of shocked journalists and activists in August and declared his defection, to when the polls opened early on Thursday morning, it was inevitable that Ukip would be celebrating the election of its first MP – a fox in the Westminster hen house, as Nigel Farage likes to say.

The party will now ruthlessly exploit all the new opportunities the office of an MP provides. They may not qualify for taxpayer-funded “Short Money” to boost their coffers, but expect questions to the Prime Minister, parliamentary debates, and maximum use of the increased media prominence Carswell will now enjoy. But what next?

Ukip’s success in the Heywood and Middleton by-election, where the party ate substantially into the traditional Labour vote, is the real game changer. The result justifies close examination of Ed Miliband’s team before the Westminster circus moves onto the next seat unfortunate enough to be besieged by bussed-in canvassers and journalists reporting “from the front line”.

In this “safe” Labour constituency in the North West, Ukip came within just 600 votes of electing its second MP. This begs the question: if Ukip can run Labour to within an inch of its electoral life in a safe seat with only limited resources, what can it do next year in more Ukip-inclined Labour seats like Rotherham or Grimsby? It’s time Labour woke up to its Ukip problem.

Branding Ukip “more Tory than the Tories” does not cut the ice with blue collar voters who find Farage’s views appealing. Merely insulting Ukip, rather than addressing voters’ underlying motives for backing the party, is certainly not going to win back people who feel abandoned by Labour. If anything, it will reinforce their view that their votes are being taken for granted.

After the revelling, reflection and recrimination of these two results, all eyes in Westminster are now switching to the next by-election in Rochester and Strood, which is shaping up to be a high stakes poker game.

Ukip can and must pour everything into securing the re-election of Mark Reckless in his Kent seat. They have the “Big Mo”, and securing a second MP would see them riding high all the way to the general election. It would no doubt encourage any other MPs flirting with defection to lay their cards on the table (any defection after 11 November may not trigger a by-election due to proximity to May’s general election).

Labour must also bet big. Miliband must show that he can win votes in swing seats (his party held the seat up to 2010). If Labour fails to increase its vote, it would be going into a general election led by someone seemingly incapable of winning in the South and barely able to hold onto safe seats in the North.

But what will David Cameron and the Conservatives do? Before Thursday’s results, everyone saw this by-election in the 271st most favourable seat for Ukip as an opportunity to stop the bandwagon in its tracks, and unite Conservatives around an epic victory in Rochester against an MP who betrayed his party.

Following Ukip’s triumph, however, some Tories might be tempted to resign themselves to another defeat and turn their focus to shoring up other marginal seats. If CCHQ piles resources into Rochester and doesn’t win, it will be a disaster for Cameron and could trigger a round of bloodletting just six months before the general election.

But accepting defeat would be a mistake. The Conservatives need this victory so they can successfully focus the minds of voters on the big battle in the New Year: Cameron versus Miliband. The next few weeks will therefore be all about expectation management. If you bet the house trying to win, you better be prepared to lose it too. Until then, the bandwagon rolls on.