I've been told, and used to adhere to, the industry standard of coffee needing to be used within the 2-14 days out of roasting rule. I've come to discover that more flavors are perceived and extraction is more consistent with espresso that is 2-6 weeks old. The reason I have found this to be true is that there isnt as much crema (aka gasses) getting in the way of flavors and also expanding the bean so much that is causes it to touch the screen, while it's being extracted, which in turn causes the puck to burn.
With brewed coffee, i'd say the gasses are more forgiving, and the optimal serve time is 1-6 weeks out of roasting.
I'd love to hear what others think of what I said and to see if anyone has tried out this idea.