  We use perturbative QCD, beyond the leading $\ln Q^2$ approximation, to show
how measurements of diffractive $J/\psi$ production at HERA can provide a
sensitive probe of the gluon density of the proton at small values of Bjorken
$x$. We estimate both the effect of the relativistic motion of the $c$ and
$\overline{c}$ within the $J/\psi$ and of the rescattering of the
$c\overline{c}$ quark pair on the proton. We find that the available data for
diffractive $J/\psi$ photoproduction can discriminate between the gluon
distributions of the most recent sets of partons.
