I'm not sure whether its common for people to barter or resell groceries but it can be done here on a small scale between friendly neighbors. If the intended goal is to resell or trade it with someone, around 1-2 years of holding might work because the longer it stays the more people would be averse to try the goods years past their manufacturing date. But if it's simply for personal consumption that can last for 3 years with good storage, I think they can markedly reduce your future food costs. If one can is equal to a stock priced at 35 and 2 or 3 years time it is valued at 36.5 or 37,you already made a "profit" from reducing food cost plus it's already taxed.
If the same logic is applied to a company stock valued at 35 now, the stock may fall or even in profit, you still have to pay some sales tax for selling. And the profit will go to purchasing food or other essentials. You already paid the value added tax on the canned good after you bought and it's already an essential good. Canned goods have been inflating for years and you could say it's as good as a short term storage of value in a weird way.
RE: Random Spiel, The Canned Goods Were the Real Investment