I've often given developers I mentor the advice they should "zig-zag" to grow their career and get varied experiences rather than stay in one place too long, but my advice was 2-3 years at each place at minimum.
I think anything less than that, and you haven't had time to really learn an ecosystem, and more importantly you might not have had a chance to live with the consequences of your technical decisions (i.e. supporting something in prod that you built).
I know plenty of people who started somewhere, left for a while, and then came back and ended up in a position higher than they would have gotten if they had stayed put and tried to climb internally.
And yes agreed that moving around will 100% grow your comp faster than staying put (in most cases).
I think anything less than that, and you haven't had time to really learn an ecosystem, and more importantly you might not have had a chance to live with the consequences of your technical decisions (i.e. supporting something in prod that you built).
I know plenty of people who started somewhere, left for a while, and then came back and ended up in a position higher than they would have gotten if they had stayed put and tried to climb internally.
And yes agreed that moving around will 100% grow your comp faster than staying put (in most cases).