Grating configurations to compress free-electron laser pulses