Fire event before cache is cleared to allow tasks to be performed before hand

Signed-off-by: Ben James <in@benjam.es>
Cache\FileStore::flush does nothing if the cache root directory doesn't exists
Merge pull request #6615 from benjam-es/cache-pre-clear-event-patch

Fire event before cache is cleared to allow tasks to be performed before...