Great question Dawn!
This topic has come up before but only as an answer or part of a comment on something else.
I generally open a container of flake food and then remove enough for a week or two to another much smaller container and leave the original closed. Air and light affect a lot of vitamins. I must confess that at the moment my purchased container of flake food has been around longer than normal as I don't have as many fish as I used to have. I really should chuck it out and buy some more so thanks for the reminder.
I guess it would be best to buy only as much as you would need in, say, 3 months. Living in Qld, Australia almost everything goes in the fridge anyway ;)
--
Repeat after me,
I will read the Immediate Help