01 - Preheat your oven to 400°F. Line a baking sheet with parchment paper to prevent sticking.
02 - Carefully unroll the puff pastry onto the prepared baking sheet. Using a sharp knife, gently score a 0.4-inch (1 cm) border around the perimeter of the pastry, ensuring not to cut all the way through.
03 - In a small 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 avoid the scored border.
04 - Neatly arrange the trimmed green asparagus spears and the thinly sliced red onion (if using) over the cheese layer. Drizzle lightly with olive oil and sprinkle with lemon zest, if desired, for an added bright flavor.
05 - Brush the scored border of the puff pastry with the beaten egg yolk. This will help create a beautiful golden-brown, puffed crust during baking.
06 - Bake in the preheated oven for 22 to 25 minutes, or until the puff pastry is visibly puffed and golden brown, and the asparagus is tender-crisp.
07 - Allow the tart to cool slightly on the baking sheet before carefully cutting it into individual squares. Serve this delightful tart warm or at room temperature.