I've created a ASP .Net MVC 3 application that allows users to search through a variety of media files based on their filenames. There are a large number of these files so I've created an inverted index which I store in memory. Specifically, I story it as a
Dictionary<string,List<string>>.
Well, this index must first be created in order to be searchable, so I created a method to build it. It works fine and everything is great, but naturally every time the AppPool refreshes, my index is lost. I've tried turning off AppPool recycling, but I'm assuming that's a bad idea (and it seems to recycle regardless).
I'm basically not sure what my next move should be. Is there a way to detect when the AppPool is going to refresh and rebuild my index? Or is it safe to disable app pool recycling altogether?
Cheers, -Josh