The shelf life of pantry items can vary, but as a general rule most canned goods and dry staples such as flour, sugar, salt, and rice will last up to two years if stored properly. Perishable ingredients like dairy products have a much shorter shelf life and should be consumed within one or two weeks.