Hi Hermit
Back in my heavier days I was up to a 6 pack of cokes a day, when I decided it was time to drop the pounds, I slowly weaned and started walking, up to 5 miles per day, it helped with the headaches.
Now 7 years later that coca-cola habit is one per day, and has been for a good while now.
While the caffeine gives headaches, the sugar can too.
I don't suggest substituting caffeine pills, wouldn't be prudent (as Dana Carvey used to say)
Good Luck!
#1 Texan