In the spirit of recent work cite{[NNT]},it is shown that $vin L^{frac{2p}{p-1}}(0,T; L^{frac{2q}{q-1}}(mathbb{T}^{3})) $ and $ abla vin L^{p}(0,T; L^{q}(mathbb{T}^{3})) $ imply the energy equality in homogeneous incompressible Navier-Stokes equations and together with bounded density with positive lower bound yields the energy conservation in the general compressible Navier-Stokes equations. This unifies the known energy conservation criteria via the velocity and its gradient in incompressible Navier-Stokes equations. This also helps us to extend the conditions via the velocity or gradient of the velocity for energy equality from the incompressible fluid to compressible flow and improves the recent results due to Nguyen-Nguyen-Tang cite[Nonlinearity 32 (2019)]{[NNT]} and Liang cite[Proc. Roy. Soc. Edinburgh Sect. A (2020)]{[Liang]}.