Cache is a set of built-in objects. Is global, similar to static Arraylist. It is thread-safe and does not need to be locked or removed when a project in the Cache is added or modified. Add Cache [Key] = object or Cache. Insert Remove Cache. Remove (key) [How to Use It] first understand the Cache policy. You can call an expiration policy or an absolute expiration policy. Note that the two cannot use the adjustable expiration policy at the same time. You need to set absoluteExpiration = DateTime. maxValue, TimeSpan. fromMinutes (10) configuration items will be removed from the Cache only if they are not used within 10 minutes. insert ("data", "123", null, DateTime. maxValue, TimeSpan. fromMinutes (10); absolute policy, such as weather report, stores information for 60 minutes Cache. insert ("data", "123", null, DateTime. now. addMinutes (60), TimeSpan. zero); cache dependency. That is, the invalidation of a cache depends on another object. The object here can refer to another cache, or a file, or .... copy code class: CacheDependency namespace System. web. caching. cacheDependency depends on other cache projects System. web. caching. cacheDependency cacheDependency = new System. web. caching. cacheDependency (null, new string [] {"time"}); Cache. insert ("number", ++ num, cacheDependency); depends on the file or folder System. web. caching. cacheDependency cacheDependency = new System. web. caching. cacheDependency ("test. xml "); when test. system is automatically removed from the cache when the xml file is deleted or updated. web. caching. cacheDependency cacheDependency = new System. web. caching. cacheDependency (null, new string [] {"time"}); Cache. insert ("test", "123", cacheDependency); remove the project callback Cache. insert ("test", "123", null, DateTime. now. addSeconds (10), TimeSpan. zero, new CacheItemUpdateCallback (Test); private void Test (string key, CacheItemUpdateReason reason, out object expensiveObject, out CacheDependency dependency, out DateTime absoluteExpiration, out TimeSpan slidingExpiration ){}