If I keep my snake in a small cage will that keep it from getting big?
No. A snake's growth is largely a product of species, availability of food, and temperature. Size of enclosure has almost nothing to do with it.
10 or 15 years ago large chain pet stores would sell baby Burmese pythons. They'd send a little kid out with an 18 to 24 snake and a year or two later the parents of the kid would come back screaming bloody murder. They would try to keep the snake in a small tank but that would have no impact on growth. The snake simply would get too large.
If you want a smaller pet consider the benefits of getting a small snake or look for a super dwarf variety of Reticulated or Burmese pythons. But even those will get relatively large just not quite as big as their full grown brothers and sister.