Tag: cache control

缓存控制:无存储,必须重新validation未发送到IIS7 + ASP.NET MVC中的客户端浏览器

我正在尝试确保某个页面永远不会被缓存,并且在用户单击后退按钮时从不显示。 这个非常高评价的答案(目前1068票)表示使用 : Response.AppendHeader(“Cache-Control”, “no-cache, no-store, must-revalidate”); Response.AppendHeader(“Pragma”, “no-cache”); Response.AppendHeader(“Expires”, “0”); 但是在IIS7 / ASP.NET MVC中,当我发送这些头时,客户端会看到这些响应头: Cache-control: private, s-maxage=0 // that’s not what I set them to Pragma: no-cache Expires: 0 缓存控制头怎么了? IIS7或ASP.NET本机的内容是否会覆盖它? 我检查了我的解决方案,我没有覆盖此标头的代码。 当我添加Response.Headers.Remove(“Cache-Control”); 首先,它没有区别: Response.Headers.Remove(“Cache-Control”); Response.AppendHeader(“Cache-Control”, “no-cache, no-store, must-revalidate”); Response.AppendHeader(“Pragma”, “no-cache”); Response.AppendHeader(“Expires”, “0”); 当我添加[OutputCache]属性时: [OutputCache(Location = OutputCacheLocation.None)] public ActionResult DoSomething() { Response.Headers.Remove(“Cache-Control”); Response.AppendHeader(“Cache-Control”, “no-cache, […]