Spices DO have a shelf life.
The difference of whole spices versus dry is remarkable: 3-6 years for whole spices and 6 months to a year for ground spices. Herbs also fall into the 6 months to a year at their very best.
The two things that age spices are air and light. Once exposed they will begin to lose their volatile oils and flavour. Over time your spices will have less intensity and begin to have less depth. Adding more doesn’t add more intensity or depth, but they don’t go 'off’. You may still use them to flavour your food.
Dry roasting spices before you use them will bring out a lot of flavour, but don’t roast too much at a time as roasted spices will lose their flavour even faster – roast only what you need. You can dry roast powders as well as whole seeds but be careful not to burn them as they will turn bitter.
Putting your spices in the fridge is not recommended. Fridges have a lot of humidity which can alter the taste of your spices. Better to keep them in a pantry setting away from heat and light.
Don’t buy a lot of ground spice. Try and get small quantities and use them up within a year. If you buy preblended spices, then you are more likely to use them up in a timely manner. You can buy larger quantities of spices like peppercorns, which you use regularly.