Prep the pans and oven: Heat the oven to 350°F (175°C).
Grease and line two 8-inch round cake pans with parchment, or use a 9x13-inch pan for a sheet cake. Lightly flour the sides.
Mix the dry ingredients: In a large bowl, whisk flour, baking powder, baking soda, salt, cinnamon, ginger, nutmeg, cloves, and espresso powder until evenly combined.
Whisk the wet ingredients: In another bowl, whisk granulated sugar, brown sugar, eggs, pumpkin, oil, milk, and vanilla until smooth.
Combine: Pour the wet ingredients into the dry. Stir with a spatula just until no dry streaks remain.
The batter will be slightly thick.
Fill and bake: Divide evenly between the prepared pans. Bake 22–27 minutes for 8-inch rounds or 28–34 minutes for a 9x13-inch pan, until a toothpick comes out with a few moist crumbs.
Cool completely: Let cakes cool in the pan for 10 minutes, then turn out onto racks. Cool until no warmth remains before frosting.
Make the frosting: Beat butter until creamy, 1–2 minutes.
Add cream cheese and beat until smooth, scraping the bowl. Mix in vanilla and salt. Add powdered sugar gradually until fluffy and spreadable.
If using, beat in espresso powder for a subtle coffee note.
Frost: For layers, place the first cake on a stand, spread a generous layer of frosting, top with the second, then coat the whole cake. For a sheet cake, spread frosting over the cooled top.
Finish and serve: Dust with cinnamon, add espresso beans, or drizzle caramel. Slice with a warm knife for clean cuts.