Crema is a food foam.
For crema to form and survive long enough for us to enjoy the espresso, something needs to hold the bubbles of the foam together.
In most food foams proteins help hold up the bubbles, but in crema it is a mixture of proteins and oils .
This makes it hard to predict what makes good crema.
From practice, good crema comes from: Enough pressure and well timed extraction
Fresh grind with a good grain size distribution Darker roasts
There are also tradeoffs between stability of the crema and the amount of crema produced.
The two don't seem to go together.
The crema also should have bubbles that pop and sprinkle the coffee aromatics into the air and our noses (like champagne).
The higher pressure extraction helps extract and emulsify the oils (about 0.1g ends up in one shot).
The darker roasts help with the Maillard reaction which creates the still unknown molecules that give crema its color and volume.
cooking.stackexchange.com/users/183/papin
The crema is done by the fatty content of the coffee, the high pressure (a good expresso machine has about 15 bar of water pressure) help to extract much fat from the coffee.
Also the quality of the coffee can influence the fatty contents; a mix of arabica and robusta type coffee can give a better crema than 100% arabica.
cooking.stackexchange.com/users/1805/pygabriel
McGee's On Food and Cooking also lists the mineral content of the water used as an important factor in crema.
He states that hard water will reduce the amount of crema produced but also that softened water causes over-extraction.
Grind size and the tamper pressure applied by the barista also make a difference to the amount of crema.
Though I don't have any results handy to back this up.
Around 30 pounds or pressure (13.5 kg) applied to tamp the grounds is considered optimal.
Test this on a scale to get a feel for it.
I've heard that some award-winning baristi will tamp with less pressure but grind the coffee finer to compensate.
As said before by SWrobel, beans should be freshly roasted 3 or 4 days prior.
Beans just roasted or within a day or two seem to produce much more crema but the crema produced is not as stable.
Possibly from too much CO2?
I am currently using a northern Italian style roast and it produces a nice think crema.
Would be interested if anyone has done any experiments on how roast profile affects crema.
cooking.stackexchange.com/users/2912/Ryan Anderson
If you source your beans from a local roaster and grind on demand you should have no problem producing crema.
The only issue is producing a crema made of fine bubbles.
Too fresh and there is generally too much gas giving you a very bubbly crema.
The origin and processing of the bean can also play a huge factor.
If you have ever tried Monsooned Malabar you'll see what I mean.
However at the end of the day you want a decent cup of coffee and taste is the only thing you can go by.
There is no ideal age for beans.
My favourite blend tastes best to me at around the 1.5-2 week mark and still produces a fine espresso.
cooking.stackexchange.com/users/4303/Megasaur
Beans should be roasted within the last week.
Ideal age is about 3-4 days past roasting, and of course they should be ground right before extraction.
cooking.stackexchange.com/users/2164/swrobel
Typically, Brazil coffee beans are used in espresso blends because of their ability to produce crema, which would remove the need for robusta type beans.
As for your answer, pygabriel has a more technical answer.
cooking.stackexchange.com/users/2083/Louis Salin
I love espresso, especially when it has a rich crema (the head that forms on top of a well made shot). I notice that some cafes produce this consistently while others never have more than a wisp on top. Which of the many factors that go in to pulling good espresso shots specifically contribute to the crema?
What factors lead to rich crema on espresso?
cooking.stackexchange.com
<coffee><drinks><espresso>
cooking.stackexchange.com/questions/5900
cooking.stackexchange.com/users/1393/Michael Natkin
A good crema requires extraction of the fatty content of the coffee through high pressure. Freshly ground beans, sufficiently soft water and well-timed extraction are also important. Several things can influence the crema: the extraction, the hardness of the water and the freshness of the roasted beans.
Good crema comes from pressure and a well-timed extraction. Crema comes from the fatty content of the coffee and is influenced by the pressure of the extraction. The hardness of the water can have an effect. The beans should have been roasted in the last few days.