You can get over the chemical dependency on caffeine in a week to ten days, if you go more-or-less cold turkey and put up with the headaches. The psychological dependency might be trickier.
In my experience the side effects of caffeine withdrawal are much much worse than for nicotine (cigarettes). Both last a week or two.
A slow taper off of caffeine is much more comfortable, even if it does take longer. Can't really speak to the nicotine side.
May I ask what your dosing was? I honestly don't doubt you one bit - but as an ex-25-a-day smoker, a week of endless pacing and sleepless nights and hiding in my cupboard, followed by a week of sleeping and grumbling, and a subsequent year of basically no alcohol (triggering), there's just no comparison to a week of headaches and thirst (caffeine). But, I suppose I do say this as someone with coffee in hand, so maybe staying quit with caffeine has been that much harder...
For caffeine, it’s hard to say, but probably at least a liter a day of Coca Cola or similar. For cigarettes, peak usage of half a pack a day. Quit both cold turkey (many years apart). Quitting soda gave me pretty significant headaches for about a week. Quitting cigarettes had no noticeable side effects other than cravings and some antsiness every hour or so. Note also that I have since relapsed on both, but was cold turkey for at least 6 months.
Quitting coca cola is different from quitting caffeine though. You are quitting sugar along with caffeine.
I definitely didn’t quit sugar, although probably reduced it significantly. I was still drinking juice pretty regularly. I’m pretty sure the headaches were primarily from caffeine withdrawal.
I have dramatically reduced my caffeine dependence in the past by slowly adjusting my morning coffee on an increasing percentage of decaf: 10% first week, 20% second, 30% the third, 50% the fourth. It was completely painless.