-
Check the sprocket capacity of both of those. Cage length doesn't change how big of a cog it can fit under (on its own)
Aren't capacity and cage length the same thing? Since cage length determines capacity.
Anyhow, @Netakure most short or medium cages have enough capacity (usually around 35tooth) for a big cassette like an 11-42, since the capacity is the difference between your smallest and biggest gear in a 1x setup. 42-11=31 So you'll need a derailleur with a 31+ capacity for an 11-42 cassette.
The next thing you have to look out for is the max sprocket size clearance, on most short and medium derailleurs that will be somewhere between 28 and 36. But like @PhilDAS and @maynardeames show, you can increase the clearance with an extender.
Hope it helps.
Check the sprocket capacity of both of those. Cage length doesn't change how big of a cog it can fit under (on its own)