缓存控制元标记

Cache control meta tags

我正在尝试使用缓存控制元标记来避免浏览器缓存我的文件。我对元标记的范围有疑问。这些标签适用于我的 html 中的每个资源请求还是仅适用于我的 index.html?这也适用于 XHR 请求吗?

does the tags apply to every resource request in my html or just my index.html?

只是 HTML 文档本身,理论上,即使如此。

HTML 5 does not mention 任何缓存控件 headers 为其定义的 http-equiv 值列表。

extensions wiki 关于 cache 的说法:

This doesn't actually work; use HTTP headers instead.


And also will that apply to XHR request?

没有


来自mnot

Meta tags are easy to use, but aren’t very effective. That’s because they’re only honored by a few browser caches, not proxy caches (which almost never read the HTML in the document). While it may be tempting to put a Pragma: no-cache meta tag into a Web page, it won’t necessarily cause it to be kept fresh.

使用真正的 HTTP headers。很清楚它们适用于什么(那个特定的请求)并且它们得到了更好的支持。