Saving global data for an ASP.net web page

I am currently working on a large-scale website that is very dynamic, so it needs to store a large amount of information in memory on an almost constant basis (for example, configuration parameters for checking or the tree used to implement the menu structure).

This information is session-independent; it is consistent for each stream using the website.

What is the best way to store this data globally in ASP, so can it be accessed when necessary, instead of reloading each time it is used?

+4
source share
7 answers

Any AppSettings in web.config automatically cached (i.e. they are not read from XML every time you need to use them).

You can also manually manage the cache yourself .

Edit : better links ...

+1
source

It is not clear whether your information is session specific or not ... if it is, then use an ASP Session object. Given your description of the scale, you probably want to look at saving state on the Sql server:

http://support.microsoft.com/kb/317604

This is approach 101. If you are looking for something a little stronger, then check memcached (which is pronounced Mem-Cache-Dee):

http://www.danga.com/memcached/

This is a system that uses apps like Facebook and Twitter.

Good luck

+1
source

Using ASP.NET caching is a good option, I think. In addition to John’s answer, you can use the Microsoft Patterns and Practices Cache Application Block command.

+1
source

This is a good video exploring various ways to save the state of an application. http://www.asp.net/learn/3.5-videos/video-11.aspx It brushes the Application object, which is global for the entire application, for all users and shows you how to create a hit counter (obviously, instead to store an integer, you can store objects). If you need to make changes, you need to use lock for concurrency, and I'm not sure how it handles BIG data volumes because I never had to store so much.

+1
source

I usually store these things in the Application object.

0
source

If the pages are dependent on each other and they are sent to each other, you can use the page request object. This is probably not the answer you are looking for, but definitely one of the smallest to use.

0
source

In the past, I came across the same situation and found that the interface is the most scalable solution. The application cache may be the answer today, but will it scale to fit your needs?

If you need to scale, you can find cookies or some type of temp database storage. Just add a new method to your interface and configure the interface to select "mode" from web.config.

0
source

Source: https://habr.com/ru/post/1286077/


All Articles