For the data is relatively large, often to be taken out of the database, you can consider the use. NET comes with cache caches that are easy to use:
//inserting a cache into memorySystem.Web.HttpRuntime.Cache.Insert ("Key","value");//Fetch Cache (first method)varCache1 = system.web.httpruntime.cache["Key"];//Fetch Cache (second method)varCache2 = System.Web.HttpRuntime.Cache.Get ("Key");//If there are no values in the cache, createif(Cache2 = =NULL) {Cache2="Cached Values"; System.Web.HttpRuntime.Cache.Insert ("Key", cache2);}//other places if you have additions, updates, or deletions, you need to update the cached values again//before updating, you can remove the original cache valueSystem.Web.HttpRuntime.Cache.Remove ("Key");//AddSystem.Web.HttpRuntime.Cache.Insert ("Key","value"+"new Value Added");//UpdateSystem.Web.HttpRuntime.Cache.Insert ("Key","the updated value value");//DeleteSystem.Web.HttpRuntime.Cache.Insert ("Key","value"+"new value after deletion");
. NET self-caching cache usage