I had a sanke kegerator in college and for the first few kegs it was always foaming. After a few kegs the foaming eventually went down.
Then after I graduated and had some money, I bought a cleaning system with some BLC (Beer Line Cleaner) and after I ran that thru the lines and then rinsed, the beer tasted so much fresher and better. I felt like an idiot for using dirty lines for so many years. After that, I cleaned the lines after (almost) every keg.
Moral of the story...clean your beer lines.