Preheat oven to 375℉.
Wash and cut asparagus spears into 1 inch pieces; discard tough woody portions of the stems.
Place asparagus, mayonnaise and shredded cheddar cheese in a large mixing bowl and stir to combine. Set aside.
Place crackers in a plastic baggie and crush them.
In a small bowl combine crushed cracker crumbs with 2 tablespoons melted butter. Set aside.
In a saucepan melt 2 tablespoons butter over medium heat.
Once butter has melted add chopped onion and cook until soft and translucent, about 4-5 minutes.
Add minced garlic to the pan and sauté until fragrant, about 1 minute.
Sprinkle the flour over the onions in the pan and stir to coat the onions. Cook for about 2 minutes to cook off the raw flour taste.
Slowly add milk to the pan and stir to incorporate with the flour and onions in the pan. Add salt and pepper.
Stir until lumps are gone and sauce thickens, about 3 minutes.
Pour sauce into the bowl with the asparagus, cheddar cheese and mayonnaise.
Stir to combine all the ingredients together.
Transfer the asparagus mixture into an oven safe casserole dish.
Spread the buttered cracker crumbs over the filling in an even layer.
Bake for 45-50 minutes until casserole is hot and bubbly.
Switch oven temperature to "broil" and toast until breadcrumbs are a rich golden brown.