acquire lock before deleting cache