ASP.Net MVC中的缓存 [英] Caching in ASP.Net MVC
问题描述
在实施缓存时我们有以下属性用于缓存位置。
任何,客户端,下游,服务器,无或ServerAndClient。我们可以在
中指定
[OutputCache(持续时间= 3600,VaryByParam =无,Location = OutputCacheLocation.Client,NoStore = true)]
Hi,
while implementing caching we have following properties for caching location.
Any, Client,Downstream, Server, None, or ServerAndClient. which we can specify in
[OutputCache(Duration=3600, VaryByParam="none", Location=OutputCacheLocation.Client, NoStore=true)]
public string GetName()
{
return "Hi " + User.Identity.Name;
}
如果我们不指定任何位置,默认情况下,位置属性为OutputCache是任何。
我的问题是当位置任何时,dot net如何决定存储缓存值的位置意味着客户端或服务器,如何确定和哪个位置优先?
if we dont specify any location, by default, the Location property of OutputCache is Any.
My question is when location is Any, how dot net decides where to store cached value means client or server,how it is decided and which location takes preference?
推荐答案
查看以下链接中的第一个成员Any:
https://msdn.microsoft.com/en-us/library/ system.web.ui.outputcachelocation.aspx [ ^ ]
Look at the very first member "Any" in the following link:
https://msdn.microsoft.com/en-us/library/system.web.ui.outputcachelocation.aspx[^]
这篇关于ASP.Net MVC中的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!