gpt4 book ai didi

asp.net-mvc - 静态内容的 MVC 客户端缓存不起作用

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

我在 web.config 中添加了以下内容

<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="10.00:00:00" />
</staticContent>

但我没有看到响应 header 过期。我还应该做其他改变吗?

enter image description here

最佳答案

我会尝试两件事来调试。首先,我将 cacheControlCustom 从 private 更改为 public

<location path="Content">
<system.webServer>
<staticContent>
<clientCache
cacheControlCustom="public"
cacheControlMode="UseMaxAge"
cacheControlMaxAge="10.00:00:00" />
</staticContent>
</system.webServer>
</location>

如果这不起作用,请检查缓存所覆盖的路径的位置。您的示例未显示该部分。

最后,尝试通过以下方式解锁机器配置的 StaticContent 部分:

appcmd unlock config /section:staticContent

这是一个包含一些其他有用信息的链接 Client Cache .

关于asp.net-mvc - 静态内容的 MVC 客户端缓存不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25776984/

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