They saw that increased blood flow to the brain through a blood vessel called the anterior cerebral artery, which is located in the middle of the brain behind the eyes. This increase in flow and resulting increase in size in this artery brought on the pain associated with brain freeze.
"Caffeine, because it blocks adenosine, has the opposite effects of adenosine. Caffeine constricts blood vessels in the head and neck, and increases the release of excitatory neurochemicals, so increases the rate of nerve firing. That's why caffeine is stimulating.
Caffeine has only one known mechanism of action at likely doses: occupation and blockade of adenosine receptors.
Whatever the cause of a given primary or secondary headache, if caffeine relieves that headache, it does so by blocking adenosine. That tells us something important about headaches relieved by caffeine: their causal mechanism involves adenosine binding to adenosine receptors.