The owner's manual says my truck has a 5.5 gal DEF tank. I waited until I was down to 1/4 on the gauge, just above the red zone, and added a 2.5 gal box of Blue DEF from Advance Auto. Now the gauge ...
Buy from the pump at truck stops. Not only is it fresh and stored in a cool place to last longer, but is also only costs about $2 per gallon.
My dealerships sells DEF. I can tell you that most of it sits out in a hot warehouse or in a hot semi-trailer for ages before being put out in the showroom which lowers the shelf life.