In fact, any information inside any knowledge point is irrelevant, is not important, the important thing is to learn the method, the process of self-exploration (wrong place welcome correct)
Summary:HTTP://WWW.CNBLOGS.COM/DUNITIAN/P/4822808.HTML#MVC
This chapter demo: HTTPS://GITHUB.COM/DUNITIAN/LOTCODEBASE/BLOB/MASTER/NETCODE/6. Web Base/bmvc5/mvc5base/controllers/ CacheController.cs
This time to relax, let's not always say safety-related things. Cache this thing is not unique to MVC, n years ago, a brief introduction of the usual project inside the use of (Redis,memcache, etc. next time to say)
1. Page cache:
First say the most common one:[OutputCache (Duration =)] , Duration unit is seconds
The first time to return to the point of the breakpoint, in 100 seconds any refresh will no longer execute the controller inside a ()
With parameter caching
[OutputCache (Duration = +, VaryByParam = "id")] [OutputCache (Duration = +, VaryByParam = "Id;name")]
The breakpoint stops at the first visit to the cache/b?id=1 and does not enter a breakpoint in 100s. Re-enter the breakpoint when id=2. Similar to multiple parameters, note that the parameter segmentation is ;
---------------------------------------------------------------------------------------------------
2. Level Two cache:(system.web; System.Web.Caching;)
2.1 Absolute Expiration Cache
HttpRuntime.Cache.Add (key, list, NULL, DateTime.Now.AddSeconds), Cache.noslidingexpiration, Cacheitempriority.default, null);
2.2 Relative Expiration cache (a bit of a session feeling)
HTTPRUNTIME.CACHE.ADD (key, list, NULL, cache.noabsoluteexpiration, new TimeSpan (0, 0, ten), Cacheitempriority.default, NULL);
2.3 Database Dependent Cache
Detailed parameters: https://msdn.microsoft.com/zh-cn/library/ms229862
Other: file-dependent cache , rarely used, usually based on the last modification time of the file to determine the timing difference
Other content can refer to Bo Friends of this article: http://www.cnblogs.com/knowledgesea/p/3904929.html
Cond......
Explore the ~~~5 of the ASP. Cache (page cache + Level two cache) for the MVC5 series