Shared data in an ASP.NET application

Posted by Barguast on Stack Overflow See other posts from Stack Overflow or by Barguast
Published on 2010-03-19T11:54:56Z Indexed on 2010/03/19 12:01 UTC
Read the original article Hit count: 160

Filed under:
|
|
|

I have a basic ASP.NET application which is used to request data which is stored on disk. This is loaded from files and sent as the response. I want to be able to store the data loaded from these files in memory to reduce the number of reads from disk.

All of the requests will be asking for the same data, so it makes sense to have a single cache of in-memory data which is accessible to all requests.

What is the best way to create a single accessible object instance which I can use to store and access this cached data? I've looked into HttpApplication, but apparently a new instance of this is created for parallel requests and so it doesn't fit my needs.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#