Nanoporous superconducting films with superconductor-insulator transition characteristics have potential application value in the field of infrared photoelectric detection, but their broadband optical response characteristics in infrared band have not been reported. Therefore, taking nanoporous niobium nitride (NbN) films as the main object, the optical response characteristics in the near and medium infrared wavelength range of 780-5000nm are studied in this paper. Firstly, the Drude-model fitting accuracy of measured NbN permittivity is improved by about 17%, and the NbN optical parameters in mid-infrared band are obtained. Furthermore, the optical response characteristics of the back-illuminated device with nanoporous NbN film are analyzed by finite difference time domain method, and a Bruggeman equivalent model which can simplify the nanoporous film into a uniform film is given to reduce the simulation dimension nanoporous NbN film from three to one. Finally, based on the equivalent model and the transfer matrix method, the light absorption characteristics of the back-illuminated device in near-/mid-infrared wavelength ranges are optimized. The results illustrate that on the one hand, simplifying the design process using Bruggeman equivalent model will not affect the correctness of the final results; On the other hand, a relatively simple optical cavity can make the detector achieve polarization-independent film absorption greater than 82% for near-/mid-infrared broadband design and 93.7% for double-wavelength design.