To make the pastry, sift the flour and salt into a large bowl. Rub in the butter until you have a soft breadcrumb texture. Add enough cold water (about 2 tbsp) to form a firm dough. Wrap in cling film and leave to rest in the fridge for 30 minutes.
Roll out the pastry on a lightly floured surface and use to line a well-buttered, deep-sided 22cm flan dish. Don’t cut off the excess pastry yet. Chill again for 30 minutes.
Preheat the oven to 200°C/400°F/Gas Mark 6.
Line the bottom of the pastry case with baking parchment or foil, then fill with baking beans. (See our how-to video below.) Place on a baking tray and bake blind (see video below) for 15-20 minutes. Remove the baking beans and parchment or foil, and return to the oven to bake for a further 5 minutes.
Using a sharp knife trim the excess pastry so that you have neat edges. Set aside.
Reduce the oven temperature to 180°C/350°F/Gas Mark 4.
Fry the bacon pieces until crisp, then drain on kitchen paper. Sprinkle the cheese over the pastry base. Arrange the sliced tomatoes on the cheese and scatter the bacon on top.
Combine the eggs, milk, and cream in a bowl and season well. Pour over the bacon and cheese. Sprinkle the thyme leaves over the surface. Bake for 40-45 minutes until the filling is just set. Remove from the oven and allow to cool before serving.