gpt4 book ai didi

asp.net - Response.Cache.SetCacheability 和 Response.Cache.SetAllowResponseInBrowserHistory 是什么意思?

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

Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);

在搜索身份验证时,我发现上面写了两行。它们是什么意思?

最佳答案

HttpCachePolicy.SetCacheability Method

NoCache: Sets the Cache-Control: no-cache header. Without a field name, the directive applies to the entire request and a shared (proxy server) cache must force a successful revalidation with the origin Web server before satisfying the request. With a field name, the directive applies only to the named field; the rest of the response may be supplied from a shared cache.



HttpCachePolicy.SetAllowResponseInBrowserHistory Method

When HttpCacheability is set to NoCache or ServerAndNoCache the Expires HTTP header is by default set to -1; this tells the client not to cache responses in the History folder, so that when you use the back/forward buttons the client requests a new version of the response each time.

关于asp.net - Response.Cache.SetCacheability 和 Response.Cache.SetAllowResponseInBrowserHistory 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3854955/

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