我在Android Chrome浏览器和桌面Chrome浏览器上进行了一些Html5应用程序缓存测试。Html5应用程序缓存:刷新页面时无法从应用程序缓存加载JavaScript文件
清单网址
/appcachetest /主/ AppManifest:
CACHE MANIFEST
# Version: 3
NETWORK:
*
CACHE:
Main
Main/Page1
Main/Page2
Scripts/jquery-1.10.2.js
#FALLBACK:
@{
Layout = null;
Response.ContentType = "text/cache-manifest";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.MinValue);
Response.ContentEncoding = System.Text.Encoding.UTF8;
}
主索引页:
<!DOCTYPE html>
<html manifest="/appcachetest/Main/AppManifest" type="text/cache-manifest">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> - My ASP.NET Application</title>
<script src="/AppCacheTest/Scripts/jquery-1.10.2.js"></script>
</head>
<body>
<iframe src="Main/Page1" style="border: 0; width: 100%; height: 100%"> </iframe>
</body>
</html>
我试过如下步骤:
- 使浏览器联机。
- 类型在地址栏的主索引页的URL,然后回车
- 页面正确加载,并且所有项目缓存。
- 关闭浏览器并重新启动。
- 使浏览器脱机并启用缓存。
- 在地址栏中输入主索引页并按回车键。
- 从缓存中加载的主索引页和JavaScript文件。
- 点击浏览器刷新按钮,JavaScript文件无法从缓存中加载。
刷新页面时有没有工作解决方案从应用程序缓存加载JavaScript文件?如何使它工作?
感谢, 博