retry auto upload if it fails
handle the case when a cached file is replaced by the latest version

If a file was cached, and the version on the server is changed, the download of the
latest version would trigger a file change event. We work around this by save the
 time of the download, and ignore the immediate event triggered after the download.