Prepare the white cake mix according to package directions for a 9×13 inch pan. Bake until a toothpick inserted in the center comes out clean. Let the cake cool in the pan for 15 minutes.
While the cake is still warm, use the handle of a wooden spoon or a fork to poke holes across the entire surface of the cake, about 1 inch apart.
In a medium bowl, whisk together the sweetened condensed milk and the cream of coconut until fully combined. If using pineapple, stir it in now.
Slowly pour the coconut mixture evenly over the warm cake, allowing it to soak into the holes. Let the cake cool completely at room temperature, then cover and chill in the refrigerator for at least 2 hours, or until thoroughly chilled.
Prepare the instant pudding mix according to package directions, using 1 cup of cold milk. Let it set for 5 minutes.
Gently fold the prepared pudding into the thawed whipped topping until just combined. Spread this creamy topping evenly over the chilled cake.
Sprinkle the toasted shredded coconut over the whipped topping. Slice and serve cold.
Notes
To toast the shredded coconut, spread it in a single layer on a baking sheet and bake at 350°F (175°C) for 5 to 10 minutes, watching closely to prevent burning.
For an extra layer of coconut flavor, substitute the milk used for the pudding with coconut milk.
This cake tastes best when served cold, so plan to keep it refrigerated until serving time.