Delete the cache at the appropriate times