  Multi-mode cavity quantum electrodynamics (QED) describes, for example, the
coupling between an atom and a multi-mode electromagnetic resonator. The gauge
choice is important for practical calculations in truncated Hilbert spaces,
because the exact gauge-invariance is recovered only in the whole space. An
optimal gauge can be defined as the one predicting the most accurate
observables for the same number of atomic levels and modes. Different metrics
quantifying the gauge performance can be introduced depending on the observable
of interest. In this work we demonstrate that the optimal choice is generally
mode-dependent, i.e., a different gauge is needed for each cavity mode. While
the choice of gauge becomes more important for increasing light-matter
interaction, we also show that the optimal gauge does not correspond to the
situation where the entanglement between light and matter is the smallest.
