In BF-21589, it was found that the cache file was being removed from the remote server while the file was being copied locally. This resulting in stale file handle exception from the cachedir, however the file was partially copied and in a bad state.
We opt for copying into a local tmp location and moving the tmp destination into the real destination only if the copy successfully complete.s