Spices DO lose their oils and flavor relatively quickly and should be discarded after a few months. My husband, a professional cook, seldom buys prepackaged spices. He either grows his own or purchases them in very small quantities at small, open-air markets.
Garlic can be kept for long periods of time. And nobody should have to go without or buy it after they start getting a harvest. Buy a good quality type and split the cloves. Plant them and nurture them. It takes about 11 months to reach maturity, and the bulb does not develop until the leaves begin to wither. Practice will teach you when to harvest. Once you harvest, leave the plants outdoors for a few days or a couple weeks, in order to dry thoroughly – too high a moisture content, when you take them indoors for storage, and they will rot. Store them in a container that does not sweat, such as paper or cardboard. It doesn’t have to be sealed, and will lend a nice garlicky fragrance to your kitchen if the container is left open. Save one or more of the bulbs and replant. Garlic will also help protect certain food plants from insect predation.
Also, to help preserve oils and naturally oily foods in the refrigerator, add vitamin E. It acts as an emulsifier and slows down the onset of rancidity. Just take a gelcap, puncture it and squeeze it into the liquid or onto the seeds, etc. Or purchase a liquid supplement and add a few drops.