Metal halide perovskite nanocrystals (NCs) are promising for photovoltaic and light-emitting applications. Due to the softness of their crystal lattice, structural modifications have a critical impact on their optoelectronic properties. Here we investigate the size-dependent optoelectronic properties of CsPbI3 NCs ranging from 7 to 17 nm, employing temperature and pressure as thermodynamic variables to modulate the energetics of the system and selectively tune the interatomic distances. By temperature-dependent photoluminescence spectroscopy, we have found that luminescence quenching channels exhibit increased non-radiative losses and weaker exciton-phonon coupling in bigger particles, in turn affecting the luminescence efficiency. Through pressure-dependent measurements up to 2.5 GPa, supported by XRD characterization, we revealed a NC-size dependent solid-solid phase transition from the γ-phase to the δ-phase. Importantly, the optical response to these structural changes strongly depends on the size of the NC. Our findings provide an interesting guideline to correlate the size and structural and optoelectronic properties of CsPbI3 NCs, important for engineering the functionalities of this class of soft semiconductors.