Heat oven to 375 degrees F. Butter a 1 1/2 to 2-quart baking dish and sprinkle with just a bit of the shallot.
Add the heavy cream to a medium saucepan along with the remaining shallot, garlic, salt and pepper. Place over medium heat and bring to a simmer while stirring. Let simmer until you see the liquid begin to thicken, 2 to 3 minutes.
Layer 1/3 of the sliced potatoes in the baking dish, cover with some Cheddar and a sprinkling of Parmesan; repeat the layering 2 more times.
Pour the hot liquid over the potatoes. Add the remaining cheese, cover with foil, and bake for 1 hour, then remove the foil to bake until the cheese is golden and brown, 15 to 20 minutes. Let rest for 10 minutes before slicing so it can settle.