Using the structured illumination, single pixel detection imaging technique SPatIal Frequency modulation Imaging (SPIFI), we demonstrate a cascaded Wavelength Domain and Spatial Domain (WD-SD-SPIFI) system enabling real-time, in-line, second order dispersion compensation optimization for multiphoton imaging. Enhanced resolution is demonstrated by imaging a sub-diffractive 140 nm fluorescent nanodiamond with Two Photon Excitation Fluorescence (2PEF) to measure the Point Spread Function (PSF). With a 1034 nm pulsed laser through a Numerical Aperture (NA) of 0.5, a PSF Full Width at Half Max (FWHM) of 780 nm was measured with minimal post processing analysis that only requires Fast Fourier Transforms (FFTs).