Typically, canned food is practically immortal. If there's no bulge, it's good and modern canning has done a lot to avoid the bulge.
Dried foods are somewhat similar, though they go rancid more readily. If you are in a super dry climate they last longer.
Foods that need refrigeration, in my experience, tend to be super close to the use by/best by dates when it comes to going bad. Exceptions are things with a lot of vinegar in them (ketchup or pickles for example). Milk, though, seems to curdle right on the the date.
An example of an exception to your last point is eggs. In the US* the eggs could have been in a refrigerator for a week or up to a year before being sent to the supermarket.
* I don’t know if this is still the case with the current 2023 high price of eggs. There has been a lot of monopoly/consolidation in eggs and it’s unclear what’s really going on.
Typically, canned food is practically immortal. If there's no bulge, it's good and modern canning has done a lot to avoid the bulge.
Dried foods are somewhat similar, though they go rancid more readily. If you are in a super dry climate they last longer.
Foods that need refrigeration, in my experience, tend to be super close to the use by/best by dates when it comes to going bad. Exceptions are things with a lot of vinegar in them (ketchup or pickles for example). Milk, though, seems to curdle right on the the date.