Preheat your oven to 350°F.
Grease and flour a bundt pan or a 9x13-inch baking pan.
In a large mixing bowl, combine the oil and sugar, and beat until well blended.
Add the eggs one at a time, mixing after each addition before adding the next.
Stir in the vanilla.
In a separate bowl, sift together the flour, baking soda, salt, cinnamon, and nutmeg. Gradually add the dry ingredients to the wet mixture, stirring until just combined.
Gently fold in the chopped apples and walnuts (if using).
Pour the batter into the prepared pan. If using a bundt pan, bake for 50 to 60 minutes, or until a toothpick inserted into the center comes out clean. If using a 9x13-inch pan, bake for 40 to 45 minutes.
Let the cake cool in the pan for about 15 minutes, then turn it out onto a wire rack to cool completely. If using a 9x13-inch pan, leave the cake in the pan.
To make the caramel glaze, melt the butter in a pot over medium heat. Whisk in the brown sugar and milk. Let the mixture simmer gently, stirring regularly, for 2 to 3 minutes. Turn off the heat, add the vanilla, and stir until smooth.
If using a bundt pan, transfer the cake to a plate.
Pour the caramel glaze over the warm cake, allowing it to soak in and create a moist, sticky top layer.