The present work investigates sidewall effects on the characteristics of three-dimensional (3D) compressible flows over a rectangular cavity with aspect ratios of L/D = 6 and W/D = 2 at ReD = 10 4 using large eddy simulations (LES). For the spanwise-periodic cavity flow, large pressure fluctuations are present in the shear layer and on the cavity aft wall due to spanwise vortex roll-ups and flow impingement. For the finite-span cavity with sidewalls, pressure fluctuations are reduced due to interference to the vortex roll-ups from the sidewalls. Flow oscillations are also reduced by increasing the Mach number from 0.6 to 1.4. Furthermore, secondary flow inside the cavity enhances kinetic energy transport in the spanwise direction. Moreover, 3D slotted jets are placed along the cavity leading edge with the objective of reducing flow oscillations. Steady blowing into the boundary layer is considered with momentum coefficient Cµ = 0.0584 and 0.0194 for M∞ = 0.6 and 1.4 cases, respectively. The three-dimensionality introduced to the flow by the jets inhibits large coherent roll-ups of the spanwise vortices in the shear layer, yielding 9 − 40% reductions in rms pressure and rms velocity for both spanwise-periodic and finite-span cavities.