The signal-to-noise ratio of infrared photodetectors can be improved by using resonant cavities, whereas the enhancement effect usually occurs in a narrow wavelength range. Here, we propose a dual-mode plasmonic resonant cavity which can enhance the performance of infrared photodetectors in a wide range of wavelengths from 3.5 μm to 5.5 μm. The optical cavity consists of an Au grating, an ultrathin (310 nm) detective layer of mercury cadmium telluride, and an Au film, which can exhibit nearly perfect absorption at resonant wavelengths with using optimal parameters. For the target wavelength range, the wavelength-averaged absorption in the detective layer can also be 62%, about 12 times of that without the resonant cavity. Such a high enhancement of absorption can occur for incident light in a broad range of angle (θ < 45⁰) and with different polarizations.