MVC3的OutputCache VaryByHeader =饼干未设置 [英] MVC3 OutputCache VaryByHeader=Cookie not being set

查看:109
本文介绍了MVC3的OutputCache VaryByHeader =饼干未设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下操作方法:

[HttpGet, Authorize, OutputCache(Duration = 60, VaryByHeader = "Cookie", Location = OutputCacheLocation.Any)]
public ActionResult Index()

但是,当我提出一个要求,这些都发布了标题:

But when I make a request, these are the headers issued:

Cache-Control: private, max-age=60, s-maxage=0
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Expires: Fri, 22 Jun 2012 09:56:32 GMT
Last-Modified: Fri, 22 Jun 2012 09:55:32 GMT
Vary: Accept-Encoding

为什么是不是包括在Cookie头的有什么不同?

Why isn't it including the Cookie header in the Vary?

我试过的的OutputCache 设置许多变化,但无济于事:(

I've tried many variations of the OutputCache settings but to no avail :(

推荐答案

我讨厌IIS作为我讨厌ASP.NET几乎一样多。

I hate IIS almost as much as I hate ASP.NET.

<一个href=\"http://blogs.msdn.com/b/chaun/archive/2009/10/01/iis-com$p$pssion-overwrites-the-vary-header-average-rating-0-ratings.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/chaun/archive/2009/10/01/iis-com$p$pssion-overwrites-the-vary-header-average-rating-0-ratings.aspx

这篇关于MVC3的OutputCache VaryByHeader =饼干未设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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