Some doujiang is always made when people make tofu, but Chinese people didn't start to like it until the 18th century. Raw doujiang has the same kinds of things in it that make people fart a lot when they eat too many beans. During the Qing, people found out that you could get rid of those things by cooking the doujiang for 90 minutes or so. After that, it became very popular. Some people sold it in the street, and others bought it fresh from tofu shops. By the Republic, Shanghai had 2 doujiang factories producing thousands of bottles a day.