Some spices can be kept for a very long time when its in is original form.
1 good eg.is black pepper /white corn.
However when it is made into powder form . eg chilli pwd., curry pwd.
nutmeg pwd .fennel pwd, cumin pwd , black / white pepper pwd.etc,
their shelf life is drastically reduced and more so if the container is opened.
Their taste / flavour/fragnance is also reduced once made into powder for sale.
Thus always buy the smallest pkt available for sale. Its hard to get small pkts from the supermkt. Thus neighbourhood shops are the best place to find them.
Indian shops may not be the best place ..... they usually sell big pkts. since the Indians love to use alot in their cooking daily.Thus buying a small pkt, of different spices can save you alot.
Normally, I do not buy black pepper pwd. but the whole peppercorn. If I need some I will panfry it for a couple of minutes over low flame till I can smell the fragnance and quickly of heat & remove to bowl or else it continue to cook and get burnt . Pound it
in a small mortar & the fragnance is great.
FYI , My mother- in- law ever had a bottle of black peppercorn kept for a few yrs in a glass bottle. ... in good condition.