Uses lockfile to prevent cache read during cache update.