Contrastive Losses and Solution Caching for Predict-and-Optimize