Why might a cake collapse after cooking I have successfuly made a Lemon Drizzle cake (recipe at end) several times, but the last 3 attempts have all collapsed in the middle to some extent.

One of the attempts collapsed in such a way it almost ended up like a ring, with a 6 cm chasm in the middle.

The ingredients and techniques have mostly been consistent


mixer: kitchen aid
oven: Aga
fat: originally used butter, 2 of the failed cakes used soft margarine. The last used butter. Uncertain whether any of the butter was salted.
flour. last techniques have used a new brand of Self Raising flour


Ingredients


225g unsalted butter , softened 
225g caster sugar 
4 eggs 
finely grated zest 1 lemon 
225g self raising flour


topping (although it collapses before this)


juice 11⁄2 lemon 
85g caster sugar 


Recipe

Beat together the butter and sugar until pale and creamy, then add the eggs, one at a time, slowly mixing through. Sift in the flour, then add the lemon zest and mix until well combined. Line a loaf tin (8 x 21cm) with greaseproof paper, then spoon in the mixture and level the top. 

Bake @ 180 c for 45-50 mins until a thin skewer inserted into the centre of the cake comes out clean. While the cake is cooling in its tin, mix together the lemon juice and sugar to make the drizzle. Prick the warm cake all over with a skewer or fork, then pour over the drizzle - the juice will sink in and the sugar will form a lovely, crisp topping. Leave in the tin until completely cool, then serve.

Note it collapses while cooling in its tin and isn't directly related to pricking the cake.
It's possible that your new brand of self raising flower has more raising agent. This causes a initial raise to happen faster resulting in large 'bubbles' that are less stable. The cake rises higher and then is more prone to falls.

Fast changes in temperature or air pressure will cause the cake to collapse. That means every time you open the oven, or if your oven isn't very air tight every time you open an close the kitchen door. Loud slams of doors are especially bad.

Higher levels of raising agent are especially an issue if you live at a higher elevation or if there is low air pressure that day.