我在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文件?如何使它工作?
感謝, 博