摘要:
MVC中OutputCache的用法[OutputCache(Duration = 10, VaryByParam ="none")]publicActionResultIndex(){ViewData["Time"] =DateTime.Now;returnView();}以上代码的意思就是说在10秒以内,数据是从缓存里面读取也可以使用配置文件来做,这样更便于管理,如下:[OutputCache(CacheProfile ="MyProfile")]publicActionResultIndex(){ViewData["T 阅读全文