While caffeine can sometimes relieve migraine symptoms, too much caffeine or sudden withdrawal can also trigger migraines.