.NET cache

xiaoxiao2021-03-06  40

ASP.NET has three caches that can be used by the web application: Output Cache: Dynamic Response Generated by Cache Request .2. Subbether: Cache Requirements The corresponding part generated by the cache request. 3. Data cache: Mixed in programming Exorbile objects.

Output cache: (Cache absolute expiration) Improve request / response throughput through the content generated from dynamic page. By default, the output cache is enabled, but the output from any response is not cached unless the response is made. Cache. To enable the corresponding to meet the output cache, it must have a valid expiration / valid policy and public cache visibility. Enable the output cache, create an output when the first GET request is issued Cache item. Subsequent GET or HEAD requests are served by the output cache item until the cache request expires. The following instructions activate the output cache when responding: <% @ outputcache duration = "60" VarybyParam = "none"%>

Picture Cache: (Separate Cache) <% @ OutputCache Duration = "120" VaryByParam = "ID1; ID2"%> VarybyParam Property is very powerful, allowing user control authors to indicate ASP.NET to cache / store output cached area on the server Multiple instances. The clip cache also supports the VaryByControl property. The VaryByParam property is based on the name / value sent by POST or GET to change the cache result, and the VaryByControl property changes the cache clips through the controls in the user control.

Page Data Cache: Put the data item into the cache: cache ["mykey"] = myValue; retrieved data from the cache: myValue = cache ["mykey"]; if (mycache! = Null) {DisplayData (myvalue);}

转载请注明原文地址:https://www.9cbs.com/read-76177.html

New Post(0)