We investigate analytically the effect on a period-doubling cascade of slowly sweeping the bifurcation parameter, by means of asymptotic calculations. First we analyse the behaviour of the orbits when sweeping through one period-doubling bifurcation. There is still an effective bifurcation called a dynamic bifurcation, but which is delayed. We compute the delay. Sweeping in forward and backward directions yields qualitatively different results. The presence of noise in the system, even of small intensity, turns out to play a key role. We analyse the various behaviours as a function of the relative sizes of the sweep rate and the noise intensity. In order to tackle the sweep through a whole cascade we extend the renormalisation theory for period doublings of one-dimensional maps to non-autonomous maps. In particular we show that a slow linear sweep of the parameter results in a new unstable eigenvalue which provides a scaling raw for the sweep rate. Taking also into account the effect of noise, we then derive an asymptotic scaling law for the delays of successive period-doubling bifurcations. As a result of the sweep (and the noise), only a finite number of doublings can be observed: we estimate this maximum number. We also show how to estimate the location of the real bifurcation points from results of experiments performed with non-zero sweep velocity. When the functions involved fail to be analytic we show that the delay of a period-doubling bifurcation due to sweep depends crucially on their degree of smoothness. In both the analytic and non-analytic cases, we give insight into the geometry of some invariant curves reminiscent of an accordion. Our analysis explains numerical and experimental results on the problem.