Dynamic compression of Ce and Pr with millisecond time-resolved X-ray diffraction