is meta http-equiv value cache control is not supported?

好久不见. 提交于 2019-11-28 01:24:10
BalusC

The <meta http-equiv> tags are only used when the HTML file in question is been opened from a non-HTTP resource such as local disk file system (via file:// URI) and not when the HTML file in question is been opened from a real HTTP resource (via http:// URI). Instead, the real HTTP response headers as set via HttpServletResponse#setHeader() are been used.

So, your concrete problem is caused because those <meta http-equiv> tags are ignored.

See also:

Joe

Only some headers are supported through the http-equiv attribute, and support is different in different browsers. For example, Mozilla only document support for:

  • content-language
  • Content-Security-Policy
  • content-type
  • default-style
  • refresh
  • set-cookie

The intention was for servers to parse this header (meta http-equiv - is it sent as part of an HTTP header, or does the client parse the body for meta tags?), but this was never widely implemented. It is implemented by Apache httpd's mod_proxy:

The other effect of enabling ProxyHTMLMeta is to parse all <meta http-equiv=...> declarations and convert them to real HTTP headers, in keeping with the original purpose of this form of the HTML <meta> element.

Using <meta> tags to turn off caching in all browsers? suggests a format that may work in more browsers but, in general, this is not a supported technique.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!