Get the oven ready
Set the oven to 375°F (190°C). Lightly coat a 9-inch pie dish with oil or butter so the quiche releases easily after baking.
Soften the vegetables
Warm the olive oil in a skillet over medium heat. Add the onion and cook until tender. Stir in the spinach and cook just until wilted. Take the pan off the heat and let the mixture cool slightly.
Mix the custard
Crack the eggs into a large bowl. Pour in the milk and heavy cream, then whisk until the mixture looks smooth and lightly airy. Add the salt and black pepper and whisk once more.
Add the fillings
Stir the cooked bacon or ham into the egg mixture. Add the sautéed onion and spinach, then mix gently so everything is evenly distributed.
Fold in the cheese
Add the shredded cheese and stir lightly. As the quiche bakes, the cheese will melt into the filling and create a rich, creamy texture.
Fill the dish
Pour the mixture into the prepared pie dish. Give the dish a gentle tap on the counter to help release any trapped air bubbles.
Bake
Transfer the dish to the oven and bake for 30 to 35 minutes, or until the center looks set and the top has a light golden color.
Rest and serve
Take the quiche out of the oven and let it sit for about 10 minutes before cutting. Slice and serve warm.