Ensure cache file is only saved once