When you plan on freezing pesto, cook the basil briefly in salted water before mixing with the other ingredients; this will help preserve its bright color and fresh taste. To freeze, spoon pesto into an ice-cube tray (2 tablespoons per cube); cover with plastic wrap. Freeze overnight, then transfer cubes to a resealable plastic bag; keep up to 6 months. Defrost pesto at room temperature, about 20 minutes (or at 30-second intervals in the microwave). Mash with a fork before using in recipes.