The effect of aspect ratio on natural convection flow in a cavity submitted to periodic temperature boundary, is investigated numerically. The temperature of the heated wall is either maintained constant or varied sinusoidally with time while the temperature of the opposite vertical wall is maintained constant. The results are given for a range of varied parameters as Rayleigh number , cavity aspect ratio , and period of the sinusoidally heated wall . The amplitude of oscillation and the Prandtl number were kept constant. The results obtained in the steady state regime show that the heat transfer averaged over the cold wall is maximum when the aspect ratio is in the range . In the case of a periodic temperature boundary, it is shown that the deviation between the mean heat transfer and the heat transfer of the constant heated case is larger for shallow cavities.