gpt4 book ai didi

cache-control - 什么是设置无缓存 ="Set-Cookie"

转载 作者:行者123 更新时间:2023-12-04 04:29:19 24 4
gpt4 key购买 nike

我正在尝试让我的标题舍入缓存。我在 vb.net 中有以下代码:

With HttpContext.Current.Response 
.Cache.SetCacheability(HttpCacheability.Public)
.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches)
.Cache.SetLastModified(Now)
.Cache.SetExpires(DateTime.UtcNow.AddSeconds(120))
.Cache.SetMaxAge(TimeSpan.FromSeconds(120))
End With

它返回以下标题:
Cache-Control: public, no-cache="Set-Cookie", must-revalidate, max-age=120
Content-Type: application/xml; charset=utf-8
Expires: Mon, 22 Aug 2016 13:54:36 GMT
Last-Modified: Mon, 22 Aug 2016 13:52:36 GMT

但我想弄清楚是什么设置 no-cache="Set-Cookie"我该如何打开或关闭它?

最佳答案

no-cache="Set-Cookie"告诉浏览器不要缓存服务器的 "Set-Cookie" header ,而是对请求的其余部分遵循不同的规则。
这是 W3C 的讨论
http://www.w3.org/Protocols/HTTP/Issues/cache-private.html

In http 1.1, Roy has proposed some features for the new cache-control directive that allow servers to selectively disable caching on specific headers. This would be, for example: cache-control: no-cache="set-cookie"

关于cache-control - 什么是设置无缓存 ="Set-Cookie",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39081537/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com