Contemporary soda fountains are trying to restore fresh ingredients, creativity and dignity to the craft. Blueplate, for instance, stocks house-made syrups, locally grown hazelnut and huckleberry shakes as well as chai-flavored soda.

“I consider myself as much of a chef as anybody else,” Peter Freeman, the founder of Brooklyn Farmacy & Soda Fountain, said last week. (His words were slightly undermined by his T-shirt, which had the word JERK emblazoned across the chest.) The Farmacy opened last year in a long-closed drugstore in Carroll Gardens, stocking locally brewed kimchi and barbecue sauce on the shelves alongside the ointment tins from the 1940s and antipsychotic medications from the 1970s that Mr. Freeman couldn’t bear to throw away when he took over the space.

“I source my own ingredients, I take pride in my mise en place, I care about plating and presentation as much as anybody else,” he said. Mr. Freeman’s extraordinary strawberry egg cream is proof of that: made with syrup from Long Island strawberries, fresh milk from the Hudson Valley that is mixed with ice (making it much colder than refrigerator temperature) and cold seltzer from the gooseneck taps that he keeps cranked up to the maximum pressure. “Big bubbles, baby,” he said, rushing a foam-topped egg cream to a table so it could be drunk before the fizz level dropped. “That’s what it’s all about.” The Farmacy is one of few places that make cola syrup, taking on Coca-Cola with a bright brew of cinnamon, nutmeg, lavender and citrus peels.

In New York, a top-notch egg cream is required for anyone revisiting the fountain tradition, including the Swiss-born chef Daniel Humm. At Eleven Madison Park, one of the more rarefied dining rooms in Manhattan, Mr. Humm has engineered an egg cream course, served to every table between dinner and dessert. It is mixed tableside from vanilla-malt syrup, organic milk from the Catskills, a drizzle of olive oil, a sprinkle of sea salt and New York seltzer squirted from old glass siphons. (This being a New York Times four-star restaurant, the sticky, scratched siphons — delivered weekly by one of the two remaining services in the city — are cleaned and polished before being allowed in the dining room.)