Once a beer is tapped, it stays fresh for 20 to 30 days. After this time, taste and smell begin to suffer. Craft or microbrewed beers generally go stale faster.
To keep beer as fresh as possible, both the inside and outside of the keg system must be kept clean. Before a keg is changed, the lines should be cleaned. The easiest and most effective way to do this is with a cleaning kit designed for the job. In addition to keeping beer fresher, regular line cleaning also stops sediment from settling inside the lines. These deposits lead to excessive foam.