Preheat oven to 350 degrees F. Lightly grease a 9- by 13-inch baking dish or 1 1/2-quart soufflé baking dish with oil; set aside. Cut off the top 3 inches of asparagus spears;transfer tips to a small bowl and set aside. Cut remaining spears into 1-inch pieces and set aside.
Heat 1 tablespoon oil in a large skillet over medium heat. Add onion and garlic and cook until soft and translucent, 5 to 7 minutes. Add 1-inch asparagus pieces, increase heat to medium-high, and cook until warmed through, 3 to 4 minutes. Remove from heat and set aside to cool slightly.
In a large bowl,whisk together eggs, milk, salt, and pepper. Stir in potatoes, cheese, and reserved onion mixture. Transfer to prepared dish and arrange asparagus tips over the top in rows. (At this point, the casserole can be baked immediately or covered and refrigerated overnight).
Bake until firm and light golden brown, about 45 minutes. Serve immediately.