Buy
this book. It is the bible.
Lots of good discussion here. There are lots of variables. From our Facebook site, where we talk about rest and shelf life:
A coffee bean has 200,000 individual cells. Each cell acts like a micro reactor. Early in the roasting process, humidity exits. Free water content vaporizes. As bean temp goes up, water vapor puts pressure onto the cell walls of the beans expanding them. As pressure goes up, coffee oils are driven into the cell walls making a sealant and holding CO2 and aroma. The cell wall is .0002 inches thick, capable of holding pressure up to 140 psi. Time to de-gas. Flavor changes occur more between days 1-5 than 6-10.
Enemies of roasted coffee:
Humidity
Heat
Air
Soon we will be releasing a container that will help eliminate at least one of these enemies.