The quality of a brew depends on the following factors (in no particular order):
- Time since coffee roasting
- Time since grinding the beans
- Cleanliness with brewing equipment
- Coffee Bean quality
- Water quality
With proper packaging, whole bean coffee can be stored up to 4 weeks in valve-seal bags and still be full flavored, though aiming for drinking within 2 weeks is ideal.
Coffee Freshness: Time Since Roasted
For freshness, at home it is better to buy popular blends that move fast, while in a supermarket vacuum packaged containers with expiration date are your best bet although all canned coffee will be stale to some extent. It should be noted that in order to vacuum pack coffee industrial coffee producers actually let the coffee sit before it is packed. As soon as coffee is roasted it starts to release CO2 in a process called outgassing. This actually helps to protect the bean from staling. Unfortunately for the people vacuum packing coffee or putting coffee in tins this also will inflate the bags. This outgassing is the reason that you will see one way valves on some coffee bags. These valves allow the CO2 to escape while keeping oxygen out of the bag.
Chances are you will not get truly fresh coffee in a supermarket. This is an absolute fact if it is pre-ground. In a coffee house look for a shop that roasts in-house and ask what was roasted that day. If the person behind the counter does not know, ask to talk to someone who cares about coffee. If no one knows, go somewhere else. As a side note, it should be mentioned that coffee is at its best after a rest of a few hours. This is one of those places that a knowledgeable roastmaster can help you. As a general rule most coffees are improved with a rest time of 12 to 24 hours. Some coffees, particularly musty or earth coffees actually mellow for the first two to three days making a longer rest better. This means that buying fresh roasted coffee online (say, Guatemalan coffee for example) and having it shipped to you provides just enough time for the coffee to develop before it arrives at your door.
Quality: Arabica Coffee Beans
Fact: If you are buying “good” coffee, bean quality is the least important of these factors. The best bean will taste bad if any one of these other characteristics is out of place. Not all coffee beans are equal but the other 4 keys to quality will even the field. I will take a lesser coffee that has been freshly roasted and ground any day over coffee that was roasted and ground then left to get stale no matter how good it was when it was fresh.
Fact: A coffee can in the supermarket often contains large amounts of robusta, low quality Arabica coffee beans and past crop (old) coffee beans. To make things worse there is no way for the major coffee companies that roast and ship all over the country to get you truly fresh coffee.
NOTE: A coffee can in the supermarket often contains a blend of Arabica and robusta coffee beans while most coffee houses sell only Arabica beans. Arabica beans are usually flavor rich, while robusta beans have more caffeine, less flavor and are cheaper to produce. The exception to this rule is that some very good espresso coffees will have small amounts of the highest quality robusta beans on the market. This is not a guarantee that a coffee house will have any better coffee than the diner down the street. If any of the previously discussed items, such as cleanliness or freshness, are not in order then the best coffee can be made to taste bad.
When you buy coffee beans, whether in a coffee house or in a supermarket, you want to get 100% arabica, except for espresso blends, which may be a combination of both. Whether good quality robusta improves the flavor of espresso is up for debate but in all likelihood this is a debate that will linger for quite some time. The robusta does contribute heavily to the crema and caffeine content of an espresso however, and is considered vital to a proper blend.
Water Quality and Equipment Cleanliness
Fact: Once you have freshly roasted and ground coffee, good water and equipment free of oil residues from the last brew, the quality of coffee beans makes a huge difference.
A final point is for best results grind your own coffee beans. Buying fresh and then having it ground defeats the purpose. Ground coffee only lasts a few hours or one day at the most if not properly protected in a valve-seal bag.