asp.net-mvc – 使用自定义输出缓存提供程序RedisOutputCachePro
发布时间:2020-12-16 03:30:16 所属栏目:asp.Net 来源:网络整理
导读:我已经按照此处的说明安装了nuget包Microsoft.Web.RedisOutputCacheProvider,用于在多个服务器实例上运行的Azure Web App,并且收到以下错误: When using a custom output cache provider like 'MyRedisOutputCache',only the following expiration policies
我已经按照此处的说明安装了nuget包Microsoft.Web.RedisOutputCacheProvider,用于在多个服务器实例上运行的Azure Web App,并且收到以下错误:
When using a custom output cache provider like 'MyRedisOutputCache',only the following expiration policies and cache features are supported: file dependencies,absolute expirations,static validation callbacks and static substitution callbacks. 配置设置如下: <system.web> <caching> <outputCache defaultProvider="MyRedisOutputCache"> <providers> <add name="MyRedisOutputCache" type="Microsoft.Web.Redis.RedisOutputCacheProvider" port="1234" host="[my host]" accessKey="[my access key]" ssl="true" /> </providers> </outputCache> </caching> </system.web> 我已经尝试将connectionString设置为有效的StackExchange.Redis连接字符串,而不是设置单个端口/主机等…但仍然收到相同的错误. 我们还使用相同的设置在同一个Web应用程序中运行Microsoft.Web.RedisSessionStateProvider,没有任何问题. 任何帮助,将不胜感激. 解决方法
将RedisOutputCacheProvider与使用AuthorizeAttribute的某些风格的安全控制器操作一起使用似乎会导致异常.它适用于AllowAnonymous操作.以下可能会有所帮助:
Why can’t I combine [Authorize] and [OutputCache] attributes when using Azure cache (.NET MVC3 app)? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 如何在SQL4的log4net配置中使用存储过程进行日志
- asp.net-mvc – ASP.NET MVC Beta授权属性发送给我错误的动
- .net – 此程序集由比当前加载的运行时更新的运行时构建,无
- asp.net – 对于单个页面,requestFiltering allowDoubleEsc
- asp.net-mvc-2 – 用于实现CanExecute样式命令的ASP MVC 2模
- asp.net-mvc-3 – 自定义错误适用于HttpCode 403但不适用于
- asp.net – Web API的XML帮助文档未在发布时更新
- asp.net-mvc – 如何在MVC3中的局部视图中渲染节?
- asp.net-mvc-3 – 如何添加整数列表到路由
- asp.net-mvc-2 – 仅在运行调试器时出现Antiforgery令牌异常