Salt tablets! and lots of water. I try to nip it in the bud before I'm laying in the shade of some tree, puking, with a killer headache and the inability to stand fully upright. No fun. A one hour bike ride or a commute is much less dangerous than a full day of touring or a century.
Last time I had it was a year ago skiing on a 12,000 foot volcano on the Fourth of July, man was it hot out! By the time you realize you've headed for a bad way, if you keep exerting yourself without taking some remedies like rest, shade, etc. you will be absolutely miserable in just a few more hours.