Nanoporous superconducting films with superconductor-insulator transition characteristics have potential application 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–5000 nm 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, thereby reducing the three-dimensional simulation of nanoporous NbN film into one dimensional simulation. 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 indicate that, on the one hand, simplifying the design process by using Bruggeman equivalent model will not affect the correctness of the final optimization results, and, 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.