We investigate infrared manifestations of the pseudogap in the prototypical cuprate and pnictide superconductors: YBa2Cu3Oy and BaFe2As2 (Ba122) systems. We find remarkable similarities between the spectroscopic features attributable to the pseudogap in these two classes of superconductors. The hallmarks of the pseudogap state in both systems include a weak absorption feature at about 500 cm-1 followed by a featureless continuum between 500 and 1500 cm-1 in the conductivity data and a significant suppression in the scattering rate below 700 - 900 cm-1. The latter result allows us to identify the energy scale associated with the pseudogap $Delta_{PG}$. We find that in the Ba122-based materials the superconductivity-induced changes of the infrared spectra occur in the frequency region below 100 - 200 cm-1, which is much lower than the energy scale of the pseudogap. We performed theoretical analysis of the scattering rate data of the two compounds using the same model which accounts for the effects of the pseudogap and electron-boson coupling. We find that the scattering rate suppression in Ba122-based compounds below $Delta_{PG}$ is solely due to the pseudogap formation whereas the impact of the electron-boson coupling effects is limited to lower frequencies. The magnetic resonance modes used as inputs in our modeling are found to evolve with the development of the pseudogap, suggesting an intimate correlation between the pseudogap and magnetism.