Between the cellar and the glass, beer travels through a system that most drinkers never see and that determines a good deal of what arrives. A well run cellar makes ordinary beer taste good; a poorly run one makes excellent beer taste stale.
The cellar
A pub cellar is a temperature-controlled room, usually held around eleven to thirteen degrees for cask ale and cooler for keg, containing the containers, the gas supply and the line connections.
Cask ale is stillaged on racking, allowed to settle for a day or more, vented to release excess gas and tapped when the cellar manager judges it ready. It is a perishable product with a few days of good condition and requires genuine skill.
Keg beer arrives filtered, usually pasteurised and sealed under pressure, and connects to gas and line without settling time.
How the beer gets upstairs
Keg beer is pushed by applied gas, either carbon dioxide or a nitrogen mix for stouts and creamier styles. The pressure has to be set correctly: too high and the beer absorbs extra gas and pours foamy over time, too low and gas breaks out in the line, producing foam for a different reason.
Cask ale is not pushed by gas at all. A handpump is a manual piston pump that draws beer up from the cellar, which is why the bar staff have to work at it. Some pubs serve cask directly from the cask by gravity instead.
Air replaces the beer drawn from a cask, which is what starts its three to five day clock. A cask breather admits carbon dioxide at atmospheric pressure to prevent that, which extends the beer's life and is a long-running point of argument among traditionalists.
The python
The bundle of tubing running from cellar to bar is called a python, and it is more than a set of pipes. It contains the beer lines wrapped around cooling lines carrying chilled water or glycol, all heavily insulated.
The purpose is to keep beer at the correct temperature along the whole run. Beer that warms in transit breaks out as foam at the tap, which is why the first pint after a quiet spell is frequently foamy and the second is fine.
Line length matters. A long run from a distant cellar holds several pints of beer, and if the pub is quiet that beer sits warming and staling in the tube.
Line cleaning
This is the part that most affects flavour and the part most likely to be skimped when a pub is busy.
Beer lines accumulate yeast, protein and bacterial films on the inner walls. Left uncleaned they impart sour, musty or vinegary flavours to every beer that passes through.
Cleaning involves flushing with a caustic or acid solution, soaking, and rinsing thoroughly, typically every one to two weeks. It takes a couple of hours and wastes the beer in the lines, which is a real cost.
The giveaway that lines are dirty is that every beer in the pub tastes similarly wrong, regardless of brewery or style. If one beer is off it is the container; if all of them are, it is the lines.
What this means for a drinker
Turnover is the single best indicator of draught quality. A pub selling a great deal of beer has fresh product in short lines and cleans them regularly because it can afford to.
A pub with twenty taps and few customers is serving beer that has been sitting in tubing for days.
Asking what is selling well is a reasonable question and gets you a better pint. And if a beer tastes musty or sour, mentioning it is worth doing, since the cause is frequently something the pub can fix and has not noticed.
Why the first pint is sometimes worse
Beer sitting in a line between servings warms towards room temperature, particularly in a long run or on a quiet afternoon.
The result is that the first pint poured after a lull can be foamy, warm and dull, while the second is fine. Many bars pull a short measure to waste before serving after a quiet period, and the good ones do it without being asked.
If a first pint arrives noticeably worse than expected in an otherwise well run pub, this is usually the explanation, and asking for a fresh one after the line has run is entirely reasonable.