01 - Preheat your oven to 400°F (200°C). Line a standard baking sheet with parchment paper to prevent sticking.
02 - Gently unroll the sheet of puff pastry onto the prepared baking sheet. Using a sharp knife, carefully score a 0.5-inch (1 cm) border around the perimeter of the pastry, ensuring not to cut all the way through the dough.
03 - In a small mixing bowl, combine the crème fraîche or sour cream with the grated Gruyère or Parmesan cheese, minced garlic, salt, and black pepper. Mix thoroughly until well combined. Spread this creamy mixture evenly over the puff pastry, making sure to stay within the scored border.
04 - Artfully arrange the trimmed green asparagus spears and thinly sliced red onion (if using) over the cheese layer. Drizzle the entire surface with olive oil and, if desired, sprinkle with lemon zest for an added brightness.
05 - Lightly brush the scored border of the puff pastry with the beaten egg yolk. This step will help achieve a beautiful golden-brown and flaky crust during baking.
06 - Transfer the baking sheet to the preheated oven and bake for 22 to 25 minutes. The tart is ready when the puff pastry is dramatically puffed and golden, and the asparagus is tender-crisp.
07 - Allow the tart to cool slightly on the baking sheet for a few minutes before carefully slicing it into individual squares. Serve this delightful tart warm or at room temperature.