Cavity thermodynamics in the Gaussian model of particle density fluctuations