I get post ride headaches too... when I don't drink enough. Seriously (not being sarcastic). I can almost predict them to a 'T' based on how much I drank, outdoor temp and distance/time I rode. Unfortunately, drinking a bunch after the headache arrives doesn't help much. It is too late at that point and usually I need a good dose of Advil to get rid of it.
Drinking extra water / sports drink pre-ride even when I don't feel thirsty most certainly helps me fend these buggers off.