Heat oven to 350° F.
In a large ovenproof skillet, over medium heat, melt the butter. Add the sugar and cook, stirring constantly, for 1 minute for caramel sauce. Remove from heat.
Arrange the pineapple slices in a single layer in the skillet. Top each slice with a bun half, cut-side down. Transfer to oven and bake for 30 minutes. Let cool for 5 minutes.
With a spatula, invert each cake onto an individual plate and spoon any remaining caramel sauce over the top. Serve with the ice cream (if using).