【发布时间】:2016-08-03 07:28:26
【问题描述】:
在 //Build/2016,Daniel Roth 在 ASP.NET Core Deep Dive into MVC 期间谈到了 TagHelpers 并展示了 Cache TagHelper。 除其他外,此标记允许缓存页面的多个部分。
在我的项目 (MVC5) 中,我需要缓存一些页面,但我无法缓存所有页面,因为在布局视图中我有一些无法缓存的用户数据。
这是我需要做的一个例子:
<html>
<head>
<!--- Head code ---->
<head>
<body>
<div id="page">
<!--- This shouldn't be cached ---->
<div id="top-menu">
<!--- User Data ---->
</div>
<!--- This should be cached ---->
<div id="page-content">
<!--- Page Data ---->
</div>
</div>
</body>
</html>
即使在 MVC5 中也有办法做到这一点?
【问题讨论】:
标签: asp.net-mvc caching asp.net-mvc-5 asp.net-core-mvc tag-helpers