I need to store large data in my website but I'm not sure what is the best to use cache objec or store the data in static variabels in the master page?
thanks alot
I need to store large data in my website but I'm not sure what is the best to use cache objec or store the data in static variabels in the master page?
thanks alot
Using the cache has the advantage, that you don't keep objects in memory that are no longer used (e.g. by using sliding/absolute expiration).
I addition, ASP.NET can remove objects from the cache when the available memory gets low (thus making more memory available).
If you are sure that you are going to use some data all the time, then another alternative (to static variables) would be to use the the Application object. This is in the same way as the Session object, but its data is global (for all sessions):
Application["myData"] = someData;