简体   繁体   English

通过不同的 URL 缓存应用程序 ASP.NET MVC

[英]cache application ASP.NET MVC BY Different Url

I have an application asp.net mvc that has different url addresses.我有一个具有不同 url 地址的应用程序 asp.net mvc。 That is, as the address changes, the data displayed on the page also changes.即随着地址的变化,页面上显示的数据也会发生变化。 I'm using OutputCache for server side cache information.我将 OutputCache 用于服务器端缓存信息。 how resolve this problem thanks如何解决这个问题谢谢

You can use VaryByParam to specify a semicolon-delimited list of query string or form POST parameters that the output cache uses to vary the cache entry.您可以使用VaryByParam指定以分号分隔的查询字符串列表或表单 POST 参数,输出缓存使用这些参数来改变缓存条目。

[OutputCache(Duration = 60, VaryByParam = "parameter")]
public ActionResult Index(string parameter)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM