Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 程序缓存_C#_Caching - Fatal编程技术网

C# 程序缓存

C# 程序缓存,c#,caching,C#,Caching,下面的代码行将做什么 这将设置缓存时间 Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); 这有什么用 Response.Cache.SetCacheability(HttpCacheability.NoCache); 这是干什么用的?。。第一行代码集缓存为什么这行代码需要true Response.Cache.SetValidUntilExpires(true); 提前谢谢 DivyaHttpCacheability.NoCac

下面的代码行将做什么

这将设置缓存时间

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
这有什么用

Response.Cache.SetCacheability(HttpCacheability.NoCache);
这是干什么用的?。。第一行代码集缓存为什么这行代码需要true

Response.Cache.SetValidUntilExpires(true);
提前谢谢
Divya

HttpCacheability.NoCache将响应头设置为无缓存,如下所述


响应.Cache.SetCacheability(HttpCacheability.NoCache)

“设置缓存控制HTTP标头。缓存控制HTTP标头控制如何在网络上缓存文档。”-

--

Response.Cache.SetValidUntilExpires(true)

“指定ASP.NET缓存是否应忽略使缓存无效的客户端发送的HTTP缓存控制头。”-