Compuware is buying web optimization company Gomez for $295 million to offer customers a unified approach toward optimizing their applications.