The coherent energy transfer between a quantum charger and a
quantum battery is analyzed. In particular, we study how to improve the direct energy transfer by adding a photonic cavity as a mediator. We show that the additional degree of freedom given by the photons consistently improves the transfer performances, above all in the off-resonant case, where there is a mismatch in the energy levels. An experimental feasible way to switch-on and off the interaction between each part of the systems and the possibility of changing the energy levels mismatch will be described, in view of finding the best working setup