On approaching the glass transition, the microscopic kinetic unit spends increasing time rattling in the cage of the first neighbours whereas its average escape time, the structural relaxation time $tau_alpha$, increases from a few picoseconds up to thousands of seconds. A thorough study of the correlation between $tau_alpha$ and the rattling amplitude, expressed by the Debye-Waller factor (DW), was carried out. Molecular-dynamics (MD) simulations of both a model polymer system and a binary mixture were performed by varying the temperature, the density $rho$, the potential and the polymer length to consider the structural relaxation as well as both the rotational and the translation diffusion. The simulations evidence the scaling between the $tau_alpha$ and the Debye-Waller factor. An analytic model of the master curve is developed in terms of two characteristic length scales pertaining to the distance to be covered by the kinetic unit to reach a transition state. The model does not imply $tau_alpha$ divergences. The comparison with the experiments supports the numerical evidence over a range of relaxation times as wide as about eighteen orders of magnitude. A comparison with other scaling and correlation procedures is presented. The study suggests that the equilibrium and the moderately supercooled states of the glassformers possess key information on the huge slowing-down of their relaxation close to the glass transition. The latter, according to the present simulations, exhibits features consistent with the Lindemann melting criterion and the free-volume model.