Preheat the oven to 350°F (175°C) and set a rack in the middle position. Grease a 9x13 inch (23x33 cm) pan with butter or cooking spray, then dust lightly with flour and tap out the excess.
Peel, core, and dice the apples into pieces about 1/2 inch (1.25 cm) across. You want a full 3 cups (about 360 g) of diced fruit, usually 3 medium apples. Set aside.
In a medium bowl, whisk together the flour, cinnamon, baking soda, salt, and nutmeg. Scoop out 1 tablespoon of this flour mixture and toss it with the diced apples until lightly coated.
In a large bowl, whisk the granulated sugar and vegetable oil together until smooth. Add the eggs one at a time, whisking after each, then whisk in the vanilla.
Add the dry ingredients to the wet ingredients and stir with a spatula until just combined. The batter will look very stiff and dry, almost like cookie dough, which is exactly right. Do not add liquid.
Add the flour-coated apples and the chopped pecans, if using, to the batter. Fold gently until the fruit is evenly distributed and the batter relaxes.
Scrape the batter into the prepared pan and smooth the top into an even layer. Bake at 350°F (175°C) for 40 to 50 minutes, until the top springs back to a light touch and a toothpick comes out with only a few moist crumbs.
While the cake cools for about 15 minutes, melt the butter in a small saucepan over medium heat. Stir in the brown sugar, heavy cream, and salt; bring to a gentle bubble and cook for 2 minutes. Remove from heat, stir in the vanilla, and let thicken before pouring over the warm cake.