Heat the olive oil in a frying pan over a medium heat. Add sliced red onion and fry for about 10 minutes, stirring occasionally until caramelised. Set aside.
Roll the puff pastry and spread the soft cheese all over its surface. Sprinkle dried chilli flakes (if using) across the pastry surface, then top it with caramelised onion.
With the longest side of the pastry rectangle facing you, roll each side of the pastry into the centre so that they meet in the middle. Brush the rolled pastry with egg wash and chill in the fridge for 20 minutes.
Preheat the oven to 180 C (fan) and line a baking tray with some baking paper or silicone mat. Using a very sharp knife, cut into 12- 15 slices. Arrange the slices on a baking tray and bake for 10- 12 minutes until puffed up and golden brown.