gpt4 book ai didi

html - 缓存控制元标记

转载 作者:搜寻专家 更新时间:2023-10-31 08:16:05 25 4
gpt4 key购买 nike

我正在尝试使用缓存控制元标记来避免浏览器缓存我的文件。我对元标记的范围有疑问。这些标签适用于我的 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其定义的 http-equiv 值列表的任何缓存控制 header 。

extensions wiki关于缓存有这样的说法:

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 header 。它们适用于什么(特定请求)一目了然,而且它们得到了更好的支持。

关于html - 缓存控制元标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35363245/

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