Preheat your oven to 375°F (190°C). Start by preparing the crust. In a large bowl, combine the flour and cubed cold butter. Use your fingers or a pastry cutter to rub the butter into the flour until it resembles coarse crumbs. Add the egg and, if needed, a tablespoon of cold water to bring the dough together. Wrap in plastic and chill for 30 minutes.
While the dough chills, prepare the bacon. In a skillet over medium heat, cook the diced bacon or lardons until crispy and golden. Transfer to a paper towel-lined plate to drain any excess grease. If using onions, cook them in the bacon fat until soft and translucent, about 5 minutes. Set aside.
Roll out the chilled dough on a lightly floured surface until it’s about ¼ inch thick. Carefully transfer it to a 9-inch tart pan, pressing it into the bottom and up the sides. Trim the excess dough. Prick the base with a fork and place a sheet of parchment paper over the dough. Add pie weights or dry beans, and blind-bake for 10 minutes. Remove the weights and paper, then bake for another 5 minutes until lightly golden.
In a mixing bowl, whisk together the eggs, heavy cream, and milk. Season the mixture with salt, pepper, and a pinch of nutmeg, which adds a subtle warmth to the flavour. Whisk until smooth and fully combined.
If using cheese, evenly sprinkle the Gruyère on the bottom of the pre-baked crust. This will create a rich, nutty base for the quiche. Next, scatter the cooked bacon (and onions, if using) over the cheese layer.
Slowly pour the egg mixture into the tart shell, ensuring it evenly coats the bacon and cheese. Use a spatula or the back of a spoon to smooth the top if necessary.
Bake the quiche in the preheated oven for 25–30 minutes or until the filling is set and lightly golden on top. The centre should have a slight wobble when shaken gently, which indicates the perfect custard texture.
Let the quiche cool for about 10 minutes before slicing. Serve warm, perhaps with a side salad, or enjoy it cold. For presentation, consider garnishing with fresh herbs like parsley or chives. This quiche pairs beautifully with a light white wine or a crisp green salad with vinaigrette.