mvc 的 OutputCache

< ![CDATA[

有人问.有没有类似asp.net web form 一样的那种标头 缓存

[OutputCache(Duration=1000)]
public async Task<ActionResult>Index()
{sxxxxxxxxx}

 当数据发生变化的时候,

Response.RemoveOutputCacheItem(Url.Action("index","home")); 
请求加载最新数据,清除缓存


一般常用的还是外部缓存redis memcache


 
]]>

你可能感兴趣的:(cache)