The only times I've been sure about the origin of a headache is when it was either from drinking or dehydration. All other times are a mystery, which is majority of the time. Caffeine prevents or eases headaches, unless you're having a withdrawal. I think I have tension headaches too.
Have you ever had an amazing success dealing with headaches or migraines using non-drowsy allergy medicine?