lock file and cache