  The ability to enhance light-matter interactions by increasing the energy
stored in optical resonators is inherently dependent on their coupling to the
incident wavefront. In practice, weak coupling may result from resonators'
irregular shapes and/or the scrambling of waves in the surrounding scattering
environment. Here, we present a non-invasive wavefront shaping technique
providing optimal coupling to resonators. The coherent control of the incident
wavefront relies on the lengthening of delay times of waves efficiently
exciting the resonator. We demonstrate our concept in microwave experiments by
injecting in-situ optimal wavefronts that maximize the energy stored in
multiple high-permittivity dielectric scatterers and extended leaky cavities
embedded in a complex environment. We expect our framework to find important
applications in the enhancement of light-matter interactions in photonic
materials as well as to enhance energy harvesting.
