I am maintaining a intranet web application that allows users to Search/Add/Edit items and run reports.
When the user searches for items or runs a report, the items/report-records were stored into Session so that I didn't have to recreate the data source for functions like paging, sorting, editing etc.
Whenever a user would open a new tab, I'd check to see if there were search results or a report in Session and if so I would warn the user about the possibility of messing things up in the other tab.
A new requirement has been added to the application that states that users should be allowed to work in multiple tabs.
I've modified the application so that it no longer stores the the search results and reports in Session. Instead it caches the search criteria used to generate the search results/report in ViewState and uses that to recreate the datasource each postback.
I found that when the user's search resulted in 4000+ items it took 13 seconds to run the search. That means that after the user has done the search...and if they caused a postback they'd have to wait another 13 seconds (this was particularity bad when the user does something small like sorting/paging etc).
I wasn't happy with this in the slightest but eventually I was told to leave it as it is because the user is expected to refine their search results to just a few items...in which case it took less than second to return.
I'm working on the reports right now.
Reports can be Very large (well over 4000 records) and I can see this lag-time being a problem.
I could continue to use Session to "cache" the search results and the reports...and create unique IDs for each tab.
The thing is that I'm worried about Session growing too large as multiple users may be connecting with multiple tabs, running search and reports in each tab. Session could potentially grow too large and cause the application to be recycled.
I'm considering using ASP.NET's "Cache" but from what I've been reading it's not really meant to be used with data that is frequently changing like this...it's really meant to be used in situations where the data remains constant for long periods of time and doesn't really change much.
I am looking for any input on this how I should cache these results (I'm even thinking of using an XML file server side...since I don't have access to a database)
Thanks a lot
-Frinny