My technique is not to fast, not to slow. Before you reach it stand up and centre your weight over the bike with a light but secure grip on the bars. Also before you hit it, pick your line. Most cattle grids will have raised sections and flat sections. The raised section is normally in the car tyre line where the road is worn or the grids buckled up slightly, to either side of that is the place to aim. Often that's more to the centre of the grid.
As you hit it, stay dead straight, let you knees buckle slightly with the impact to absorb some force, stay relaxed and you'll be over it.
I used to cross 3 or 4 deer grids on a regular ride, one of them uphill at only 6 or 7 mph, which requires the same technique but using a smooth and fluid pedal action so you don't need to throw too much weight from side to side.
So far no mishaps.