So I have a web service that returns data from a certain data source. Some of the data retrievals takes really long (>15 sec) which is unacceptable while serving data to a web page via ajax calls.
I was thinking that I can cache the data in the following method:
Run a worker thread in Global.asax that retrieves deltas every X minutes/hours and updates a variable, which will then be returned in the web service. The best solution that came to my mind was saving the data in the Application dictionary.
Basically my question is, should I do it? (We are talking about data that can exceed 100MB) Are there any ramifications doing it? If so, what solution will be best?
You're probably better off using caching for this case, as it will automatically be flushed out if the server is running low on memory.
See 'Application Considerations' here: https://msdn.microsoft.com/en-us/library/ms178594.aspx