What were your symptoms?Esophageal cancer at 31? Nah. It's incredibly rare at that age. It's a rare cancer full stop. Cases are increasing in line with the rising rate of reflux disease and obesity. but it's still not common. In young people, it's almost unheard of. It generally takes decades of untreated, chronic reflux. Even then, most people with reflux don't get esophageal cancer. Most people with Barrett's Esophagus don't get cancer. It just increases your risk.
It's a very aggressive form of cancer that takes hold very quickly. People with esophageal cancer tend to suddenly find they literally can't get food down. Your esophagus essentially stops working.
Your trouble sounds like reflux. Perhaps you have a bit of esophagitis or, at worst, a hiatal hernia. You do have a condition worth seeing the doctor about, but demanding an endoscopy is a stretch. Have one if the doctor thinks you need one. The doctor will almost certainly want to see if a PPI has any impact before sending you for one, though.
I've just been through the whole thing myself and I'm doing alright now.