Put oil in a large pan. Add onions and cook until beginning to soften and brown.
Add sugar, vinegar, salt and pepper. Turn the heat down and continue to cook unjtil caramelized, about 20 minutes
Roll pastry into a 10-to-14-inch rectangle . Place pastry on a baking sheet lined with parchment paper. Prick with a fork all over to prevent the pastry from forming big bubbles while baking.
Place onions over pastry, cover to the edges. Dot with cheese. Sprinkle with tarragon.
Bake in a preheated oven at 400°F for 15-18 minutes or until cheese has melted and pastry is crispy.