For the first time, the effect of pressure fluctuations on the averaged shear stress in a shear viscous flow over a two-dimensional rectangular microcavity containing a pulsating gas bubble is studied. This problem formulation can be regarded as a model of a fluid flow in a viscous sublayer of a turbulent boundary layer in a vicinity of microcavities of a striped superhydrophobic surface. The aim of the study is to analyze possible non-stationary mechanisms resulting in an average velocity slip and a friction reduction in a turbulent boundary layer on a superhydrophobic surface. The method of boundary integral equations is used to solve numerically the Stokes equations describing a shear-driven viscous flow in a viscous sublayer over a single microcavity containing a compressible gas bubble.