We present the results of an experimental investigation that uses two different techniques for controlling a shallow cavity flow in the Mach number range 0.25-0.5. The first method is basically an open-loop design that relies on zero-net-mass forcing at an optimal frequency for suppressing the cavity flow resonance. The second method is a parallel-proportional with time delay controller, a linear control design that relies on real-time feedback from the flow to counteract the resonance. With properly tuned parameters, both methods are successful in reducing the cavity resonance for flows in the Mach number range explored. However the parallel-proportional controller exhibits a superior robustness with respect to departure of the Mach number from the design conditions, a signature of feedback control designs that are naturally more capable to handle changes of the open-loop plant. An additional benefit of the feedback control method is the lower power requirement to achieve comparable suppression of the resonance. An interpretation is presented of the physical mechanisms by which the optimal forcing frequency and the parallel-proportional with time delay controller reduce the cavity flow resonance. The results support the idea that the optimal forcing frequency control induces in the system a rapid switching between modes competing for the available energy that can be extracted from the mean flow. In the case of parallel- proportional control mode switching is also observed which involves a larger range of frequencies and spreads more the extracted energy thus producing a flow with a quieter, more broadband spectral signature.