take the existing cache into account when fetching

Previously, we would always generate $i values, which is not what we
want, we want the $i'th value...