First, you need to make sure that your IIS workflow has permission to write / delete files from your cache directory (and not the rest of your site, just in case)
2nd, I would stay away from using App_Start and App_End, the end of the file cleaning application was not 100% guaranteed, and you could get a growing bunch of lost images.
I would do the planned process, perhaps once an hour, or once a day, depending on what you want. And check how old each image in your cache is, and if it is older than your arbitrary "expiration time", then delete it.
In addition, it is not so much.
source share