Preheat oven to 350°F and spray a 9x9-inch or 1½ quart casserole dish with cooking spray.
In a small bowl, stir the sugar, flour, baking powder, salt, and red pepper flakes together.
2 tablespoons granulated sugar, 2 tablespoons all-purpose flour, 1 teaspoon baking powder, 1½ teaspoons kosher salt, ¼ teaspoon crushed red pepper flakes
In a large bowl, whisk the eggs, cream, and melted butter together.
3 large eggs, 1 cup heavy cream, ¼ cup unsalted butter
While whisking, add the sugar mixture to the egg mixture. Whisk until smooth. Add corn (and bacon, if using) and stir until combined.
3 cups corn kernels, 4 slices crumbled cooked bacon
Pour mixture into sprayed baking dish and bake at 350°F just until set in the middle and golden brown, 45-60 minutes.
Remove from oven and let stand 5 minutes before serving.
Garnish with your favorite herb and serve.
Chopped fresh herbs