gpt4 book ai didi

html5-appcache - HTML5 AppCache 如何处理重定向?

转载 作者:行者123 更新时间:2023-12-01 02:22:15 26 4
gpt4 key购买 nike

如果我包含在我的应用程序缓存 list 中:

/example.html

这重定向到
https://s3.amazonaws.com/longURL/example.html?dynamicauthenticationparameters

这会起作用吗?

当前的 HTML5 规范草案似乎对内容文件的重定向(与 list 本身相反)保持沉默,除了提到手动重定向标志,该标志显然已设置,但(据我所知)从未实际使用过。

(目的是避免代理某些 S3 内容,但仍然使用缓存机制使其离线可用。如果上述无法完成,JavaScript 和 LocalStorage 可能是一种解决方法)。

任何指向规范和/或当前浏览器实现行为的相关部分的指针都会有所帮助。

最佳答案

当前规范现在规定,如果资源被重定向到不同的源,那么这将被视为失败并使用本地缓存副本(或回退)。

http://www.w3.org/TR/2011/WD-html5-20110525/offline.html 的第 5.6.4 节中它指出:

Redirects are fatal because they are either indicative of a network problem (e.g. a captive portal); or would allow resources to be added to the cache under URLs that differ from any URL that the networking model will allow access to, leaving orphan entries; or would allow resources to be stored under URLs different than their true URLs. All of these situations are bad.



很遗憾,您无法从 Amazon S3 或 Cloudfront 提供某些页面。

关于html5-appcache - HTML5 AppCache 如何处理重定向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19430006/

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