length of cage is often independent of cassette capacity.
rear mechs are spec’d by (exclduing pull ratio and speeds):
* What the maximum sprocket size they have handle; and
* How much slack chain they can deal with (capacity in teeth – difference between big ring and little plus difference in teeth between little sprocket and big sprocket added to the chainring difference.) – longer the cage bigger the capacity to deal with more chain slack.
You might find an older 8 speed mech might not be able to deal with the 32, but fit it and see – you will have to play with the ‘B’ Adjust screw to get the correct clearance from mech top jockey wheel and 32 sprocket..
worth trying before you buy a new mech – nowt to lose by seeing