  Under a sharp asymptotic growth condition at infinity, we prove a Liouville
type theorem for the inhomogeneous porous medium equation, provided it stays
universally close to the heat equation. Additionally, for the homogeneous
equation, we show that for the conclusion to hold, it is enough to assume the
sharp asymptotic growth at infinity only in the space variable. The results are
optimal, meaning that the growth condition at infinity cannot be weakened.
