gpt4 book ai didi

html - 元标记中 http-equiv = "pragma"和 http-equiv = "cache-control"的替代

转载 作者:行者123 更新时间:2023-11-28 02:50:11 25 4
gpt4 key购买 nike

在我用于缓存控制的 JSP 文件中,我使用了 pragma 指令作为

<meta http-equiv="pragma" content="no-cache" >
<meta http-equiv="cache-control" content="no-cache" >

但是在使用 w3c 验证器验证我的页面时,我遇到了以下错误

Bad value pragma for attribute http-equiv on element meta.

Bad value cache-control for attribute http-equiv on element meta.

所以我正在寻找替代方法来通过这种情况下的 w3c 验证。

PS:我是 JSP 和 HTML 的初学者。提前致谢

最佳答案

使用HTTP headers instead .

You can set them using setHeader.例如

 httpResponse.setHeader("Pragma", "no-cache"); // HTTP 1.0

关于html - 元标记中 http-equiv = "pragma"和 http-equiv = "cache-control"的替代,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39701832/

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