Most canned foods, if stored in cool temps, away from sunlight (temperature variations or heat can play havoc with the food), will be good for several years. (Five years is probably max for most grocery-bought wet-pack cans, though there will be exceptions.)
Unfortunately, there isn't an ironclad rule of thumb you can apply, as some canned foods--especially highly-acidic foods like tomatoes and their sauces and yes, pineapples, will go bad. Two years for those types of wet-packed canned foods would be maximum.
One thing to look for in any type of canned food storage is cans that look to be expanded. Throw them away without even opening. Botulism is nothing to mess with. Rusted cans or any can that looks to be leaking--trash them.
Otherwise, you do need to practice some kind of rotation--even if only swapping out your grocery canned foods every couple of years (assuming they haven't been exposed to high heat or frozen, in which case more frequent rotation would be called for).
You're right that you do not want to be having to cross your fingers that your stored food will be OK when you really do need to count on it after some emergency.
Hence, the huge popularity these days in canned foods that are specifically produced and canned for long-term storage--wet-pack meats, canned powdered milk, dehydrated fruits, veggies, and other staples, and freeze-dried entrees. They are going to be good for decades in most cases (again--good storage practices are recommended). And as for portability of those foods--at least the dried foods--they are going to be far more lightweight and easy to move around.
Also, there are many dried foods in pouches that have shelf lives of 5-7 years. Those are increasingly popular and used not only for camping, but for emergency food storage.
My professional perspective--It's a fact that more and more folks are into preparedness these days who are not wanting to bother with rotation. So they are purchasing long-term food storage products. In fact over the last year, consumer demand for those foods has swamped and even totally shut-down major producers of these foods. The economy, major natural disasters in the news, and rumors of war are just a few of the scenarios that cause people to seriously get into food storage today.
It's common sense. And its also about peace of mind. Whatever works for you in your situation--more power to you! Of course most folks by now are aware that to rely on the government to show up and rescue you and provide for your needs, well--that's a tear-jerker waiting to be written. Avoid that ending at all costs.