ASP.NET MVC缓存因控制器操作参数而异 [英] ASP.NET MVC Caching vary by controller action parameter

查看:100
本文介绍了ASP.NET MVC缓存因控制器操作参数而异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以使用 outputcache 属性?我们有 varybyparam ,如果我的参数以REST方式嵌入URL中,则无法使用。

Is there any way I can vary caching by a controller action parameter using the outputcache attribute? We have varybyparam which will not work if my parameters are embedded within the URL in a REST manner.

推荐答案

缓存可以通过这种方式进行默认情况下。不同的URL提供不同的缓存位置。也许您的问题中遗漏了一些东西,但是如上所述,它已经可以这样工作了。

Caching works this way by default. Different URLs give different cache locations. Perhaps there is something missing from your question, but, as stated, it already works this way.

这篇关于ASP.NET MVC缓存因控制器操作参数而异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆