over heating,not my mopar tho

So why would one day it pukes up and than is fine after the cap change?,if the head gasket was bad it should be the same issue all the time or am I missing something here.

If it's OK now it could have just been a bad cap. Drive and keep an eye on it for a while.