加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

cache-control – 什么是设置no-cache =“Set-Cookie”

发布时间:2020-12-14 23:28:24 所属栏目:资源 来源:网络整理
导读:我正试图让我的头球更好.我在vb.net中有以下代码: With HttpContext.Current.Response .Cache.SetCacheability(HttpCacheability.Public) .Cache.SetRevalidation(HttpCacheRevalidation.AllCaches) .Cache.SetLastModified(Now) .Cache.SetExpires(DateTim
我正试图让我的头球更好.我在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”标头,而是对请求的其余部分遵循不同的规则.
这是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”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读