It seems from the history that you are having recurrent headaches
associated with vomiting.
These symptoms indicate usually primary headaches in the form of migraine
Migraine headaches usually respond to anti-inflammatory drugs as in your case but may recur at frequent intervals.
The prophylactic drugs are required to prevent recurrences. The commonly used prophylactic drugs are flunarizine
or beta blockers like propranolol
Hence I advice you to consult your doctor for examination and prescription of drugs.