I first went to AppFabric - caching (aka Ms Velocity) and checked msdn virtual labs.
https://cmg.vlabcenter.com/default.aspx?moduleid=4d352091-dd7d-4f6c-815c-db2eafe608c7
There is code in this example that I am not getting. It creates a cache object and stores it in a session state. The documentation only says:
We need to save the cache object in Session State and get the same instance of this object every time we need to use it.
That's not the way I used the cache in ASP.NET. What is the reason for this template and do I need to use it?
private DataCache GetCache() { DataCache dCache; if (Session["dCache"] != null) { dCache = (DataCache)Session["dCache"]; if (dCache == null) throw new InvalidOperationException("Unable to get or create distributed cache"); } else { var factory = new DataCacheFactory(); dCache = factory.GetCache("default"); Session["dCache"] = dCache; } return dCache; }
, DataCacheFactory - - , .
DataCacheFactory
, , - DataCacheFactory , DataCache, DataCache , , .
DataCache
, , DataCacheFactory , , .
Source: https://habr.com/ru/post/1727163/More articles:Returning a two-dimensional array from an SQL query - sqlCreating a document format in MS Office format to display document properties - pythonCodeigniter check - how to limit a numerical value? - validationHow can robots.txt ignore anything with action = history in it? - seoValidated Treeview nodes do not return in order - asp.netЕсть ли способ повторно использовать шаблоны редактора и отображения в приложениях asp mvc? - asp.net-mvcjQuery (this) .val () does not return the value of the selected parameter - jqueryExtract first word from UITextView - iphoneHow to programmatically create a Silverlight sequence animation? - silverlightSet auto_increment load after saving - phpAll Articles