为什么缓存 HTML5 页面会阻止执行 Cors 请求?

Why caching HTML5 page prevent doing Cors request?

为什么缓存应用程序会阻止 Cors 请求?

我有一个例子,两个 html 页面完全相同,除了第二行:

index.html link

<!DOCTYPE html>
<html manifest="main.appcache">

index2.html link

<!DOCTYPE html>
<html>

为什么没有清单的工作正常而有清单的只在第一次工作并在应用程序停止时停止工作缓存? (多次按F5)

我用 Firefox、Chrome 和 IE 进行了测试。

根据this article

NETWORK: Files listed in this section may come from the network if they aren't in the cache, otherwise the network isn't used, even if the user is online. You can white-list specific URLs here, or simply "*", which allows all URLs. Most sites need "*".

所以您描述的行为是恰当的,因为您的应用程序缓存清单不包含 NETWORK 部分。

更新:请求失败 - 不是 CORS - 因为域、协议和端口相同。