1 Put the rice flour, cornflour, polenta, salt and baking powder in a blender or food processor. Pulse to combine. Add the butter and blend until the mixture resembles breadcrumbs. Put into a mixing bowl and work in the potato until blended.
2 Turn out onto a lightly floured surface. Knead for 2 minutes until smooth. Shape into a disc and wrap in cling film. Chill for 30 minutes.
3 Heat the oven to 200°C (180° fan) 400°F gas 6. Grease a 23cm|9" springform flan tin.
4 Roll out the pastry between 2 sheets of non-stick baking paper and press into the tin. Prick the pastry all over with a fork, line the pastry case with non-stick baking paper and fill it with rice or dried beans. Bake for 15 minutes, then remove the paper and beans and set aside.
5 Reduce the oven temperature to 170°C (150° fan) 325°F gas 3.
6 For the filling: heat a frying pan, and the bacon and cook until just starting to colour. Drain on absorbent kitchen paper.
7 Dice 3/4 of the cheese and finely grate the rest. Scatter the diced cheese and bacon over the base of the pastry case.
8 Beat the creme fraiche, then slowly beat in the cream. Mix in the beaten eggs. Season (you shouldn't need much salt) and add the nutmeg and thyme.
9 Place the flan tin on a baking tray. Carefully pour the filling into the pastry case. Sprinkle over the grated cheese.
10 Bake for 30-40 minutes, until softly set. Cool in the tin for 10 minutes before serving.