Preheat the oven to 350°F. Coat an 8- by 8-inch (or similar) gratin dish with the oil and set aside.
Heat a medium skillet over medium heat. Add the pancetta, and cook, stirring occasionally, until crisp, 6 to 8 minutes. Set aside.
Meanwhile, toss the potato slices and flour in a large bowl, using your hands to distribute the flour evenly. Season the potatoes with salt and pepper (the amount of salt you use should depend on how salty your pancetta tastes). Cut the cheese into thin slices. (You can leave the rind on.)
Spread one-third of the potatoes along the bottom of the dish, overlapping them as necessary. Scatter one-third of the cooked pancetta over the potatoes, followed by one-third of the cheese, broken up into little bits. Repeat with the remaining ingredients, making two more layers, ending with pancetta and cheese. Whisk the cream, milk, and egg together in a small bowl, then carefully pour the liquid mixture over the potatoes.
Cover the gratin tightly with aluminum foil and bake for 30 minutes. Remove the foil, increase the temperature to 400°F, and bake 40 to 45 minutes longer, or until the potatoes are lightly browned on top and a skewer can pierce through the layers easily. Let cool for 10 to 15 minutes before serving.