I have a ASP.NET application which implements a custom in-memory cache. I'm using this as opposed to ASP.NET's caching mechanism as I needed a more complex way to handle what to drop from the cache. Part of this custom cache is a separate thread which occasionally searches for data to drop from the cache whenever it gets too large.
What I need to do is signal this cache maintenance thread to stop whenever the ASP.NET application 'exits'. I guess this basically amounts to when the web site is stopped in IIS.
Is there a pre-existing event I can utilise to do this? Thanks.