Step 1Heat the oven to 350 degrees.
Step 2Peel the mangoes. Holding each mango upright, cut away the flesh from both sides of the pit in broad lengthwise slices. Cut those slices again, lengthwise, into three-fourths-inch-thick pieces. Each mango should yield 6 to 8 pieces. Set aside.
Step 3In a large 10- to 12-inch skillet, preferably cast iron, melt the 3 tablespoons butter over medium heat; then add the brown sugar, stirring until melted, smooth and incorporated, 1 to 2 minutes. Remove the pan from heat. If you are baking your cake in the skillet, spread the sugar mixture to the edges and set the pan aside to cool. If you are baking your cake in a springform pan, spread the melted sugar into a 9-inch round springform pan. (Line the base of the pan with parchment paper, to about one-half inch up the sides of the pan.) After the caramel mixture has cooled, arrange the mango slices tightly side by side in a radiating circle in the pan, so that the surface of the pan is entirely covered. Scatter any remaining mango on top of the first layer in a small second layer. (The fruit will cook down considerably in the oven, so you will want to be generous with it.)
Step 4In a large mixing bowl, beat the remaining one-half cup butter until pale. Add sugar and continue mixing until pale and fluffy. Add eggs one at a time; mix well to combine. Stir in the vanilla and coconut flakes.
Step 5In another large bowl, combine flour, baking powder, salt, cardamom and allspice. Stir with a fork to incorporate. Then, working in batches and alternating with the coconut milk, mix the dry ingredients into the egg mixture: Begin by adding a bit of the dry ingredients and stir until just combined, then add a bit of the coconut milk and stir until just combined, and so on, until all the ingredients are incorporated.
Step 6Spoon and spread the batter into the pan so that the mangoes are evenly covered. Bake the cake until it is springy and golden and a knife inserted into the center of the cake comes out clean, about 45 minutes (a springform cake will require additional time).
Step 7Cool the cake in the pan for 10 minutes. Then, if using a skillet, place a large plate over the top and carefully flip the pan so that the cake inverts onto the plate with the mango on top. (If using a springform pan, place a plate over the pan, flip the pan over, release the spring mold, and peel back the parchment.) The cake will be best on the day that it is made. Serve it slightly warm or at room temperature.