In an ASP.NET MVC application I'm performing calculations which are in an xlsx
file. We are talking about 18K variables in the calculations (xlsx
file is around 10MB), so loading them them into a SpreadSheetGear
instance takes a while. Therefore I need to cache the SpreadSheetGear
object in between requests otherwise each request would take forever.
Right now I'm using In-Proc Application Cache and Session Cache to save the data between requests. In my test environment the Application Pool of the IIS recycles way sooner (sometimes just a few minutes) than our session timeout (I think the default 20 minutes). The Pool recycle causes the loss of all In-Proc cached data, and the lengthy load procedure has to happen again.
- As far as I can see there's no function to serialize the SpreadSheetGear object (other than to save it in xlsx format for example). If I could serialize it, then I could maybe switch over to an out of process caching vehicle. But even then I'm a little skeptic how that would perform compared to the In-Proc memory cache.
- I couldn't figure out why the recycle happens. The server is memory starved though, but I don't have any memory limit or VM memory limit set for the IIS App Pool. I don't find the recycling events in the IIS log.
- Is there any way to shelter that In-Proc memory data to survive an App Pool recycling?
Does anyone have similar experience with SpreadSheetGear + ASP.NET MVC + IIS?