Preheat the oven to Gas Mark 4,180C (350 F). Lightly butter a 35 x 11cm loose-bottomed flan tin. Heat a large non-stick frying pan. Add a knob of the butter and cook the onion for 4-5 minutes until softened but not coloured. Stir in the spinach and cook for a few minutes until wilted, stirring. Turn the mixture into a sieve and press well with a wooden spoon to squeeze out all of the excess liquid. Melt the remaining butter in a small pan or in the microwave. Lay one sheet of filo across the base of the tin with the edges slightly overhanging the sides. Brush with melted butter. Repeat with the remaining sheets, arranging them at different,overlapping angles. Spoon the spinach and onion mixture into the pastry case and scatter the ham or bacon on top, then grate or crumble over the cheese. Beat together the eggs, crème fraiche and seasoning in a bowl, then pour into the pastry case. Bake for 30minutes until the filling is set and the filo pastry is golden.
To serve, cut into slices and arrange on plates with salad and new potatoes.