If you have a very large shared file store cache, and it is completely purged eg after a release, then it uses a file glob to iterate over the files and delete them which can be fairly slow with millions of files. The file deletion doesn't need to block the release from finishing.
Proposing to add a new option to the file cache store which when set stores all cache keys under an extra version key:
When a purge happens, it just bumps the key to invalidate, and then fires of an adhoc task to slowly delete the old set of data.
The $CFG->localcachedirpurged key should be well suited, or something new so it could be 1 key per store instance.
Or alternatively don't make an option and just make this the way it works for everyone.