gpt4 book ai didi

html - http-equiv Cache-Control 和 Pragma 指令是否有符合 HTML5 的替代方案?

转载 作者:行者123 更新时间:2023-11-28 01:23:24 26 4
gpt4 key购买 nike

我正在更新站点的 HTML 以使其符合 HMTL5。现有站点具有以下两个元 http-equiv 元素:

  • 缓存控制
  • 语用

这两个是否符合 HTML5 标准?如果不是,我应该用什么替换它们以使我的网站符合 HTML5 标准?

我发现此链接列出了有效的 http-equiv pragma:

http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv

列表中不包括 Cache-Control 或 Pragma。

提前致谢。

最佳答案

缓存相关编译指示不合规:

Pragma directives corresponding to headers that affect the HTTP processing model (e.g. caching) must not be registered, as they would result in HTTP-level behaviour being different for user agents that implement HTML than for user agents that do not.

HTML5 中没有其他选择。

以下是 HTML5 的相关 http-equiv 编译指示:

The http-equiv attribute is an enumerated attribute. The following table lists the keywords defined for this attribute. The states given in the first cell of the rows with keywords give the states to which those keywords map. Some of the keywords are non-conforming, as noted in the last column.

State                       Keyword                 NotesContent Language            content-language        Non-conformingEncoding declaration        content-type    Default style               default-style   Refresh                     refresh     Cookie setter               set-cookie              Non-conformingX-UA-Compatible             x-ua-compatible     Content security policy     Content-Security-Policy     

引用资料

关于html - http-equiv Cache-Control 和 Pragma 指令是否有符合 HTML5 的替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33032866/

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