Nonlinear long wave propagation in a medium with periodic parameters is considered in the framework of a variable-coefficient Korteweg-de Vries equation. The characteristic period of the variable medium is varied from slow to rapid, and its amplitude is also varied. For the case of a piecewise constant coefficient with a large scale for each constant piece, explicit results for the damping of a soliton damping are obtained. These theoretical results are confirmed by numerical simulations of the variable-coefficient Korteweg-de Vries equation for the same piece-wise constant coefficient, as well as for a sinusoidally-varying coefficient. The resonance curve for soliton damping is predicted, and the maximum damping is for a soliton whose characteristic timescale is of the same order as the coefficient inhomegeneity scale. If the variation of the nonlinear coefficient is very large, and includes the a critical point where the nonlinear coefficient equals to zero, the soliton breaks and is quickly damped.