What he did and what I meant is he put one row of stakes pointed out. Almost every cavalry charging in will be killed. Some cavalry doesn't charge but marches through the gate. If they route they get killed by a second row of stakes pointed in.

I use this tactic but add a box of stakes to stop cavalry that marches through the gate and charges the second line of defense.