Prep Time 10 minutes mins
Cook Time 25 minutes mins
Resting Time 5 minutes mins
Total Time 40 minutes mins
For best flavor, use freshly grated cheese instead of pre-shredded, as it melts more smoothly and gives the dip a creamier texture; if you prefer a sweeter flavor, slowly caramelize the onions in a skillet with a little butter before mixing them into the dip, then reduce the bake time slightly since they are already cooked. You can prepare the mixture up to a day ahead and refrigerate it covered, then bake just before serving, adding a few extra minutes to the baking time for a cold dish. To avoid a greasy dip, stick to full-fat dairy but avoid extra oily cheeses, and pull the dip from the oven as soon as it is bubbling and lightly browned rather than deeply dark. Adjust the seasoning after baking if needed, stirring in a pinch more salt or pepper, and if the top browns too quickly, tent loosely with foil during the last few minutes of baking.