我有一个 OpenUI5 应用程序;我的应用程序只有一个 htlm 页面(index.html)、一些 js 文件(用于逻辑控制器)和一些 xml 文件(用于视图)。
该应用程序是单页应用程序;这是我的index.html
起始页:
<!DOCTYPE html>
<html manifest="app.appcache">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<!--<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />-->
<title>My App</title>
<!-- UI5 Bootstrap with OpenUI5 -->
<script id="sap-ui-bootstrap"
type="text/javascript"
src="resources/openui/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-libs="sap.m"
data-sap-ui-resourceroots='{
"ui5bp": "./",
"model": "./model"
}'
>
</script>
<!-- Custom Styles -->
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script>
new sap.m.Shell("Shell", {
showLogout : false,
app : new sap.ui.core.ComponentContainer({
name : 'ui5bp'
}),
homeIcon : {
'phone' : "img/57_ogo.jpg",
'phone@2' : "img/114_logo.jpg",
'tablet' : "img/72__logo.jpg",
'tablet@2' : "img/144_logo.jpg",
'precomposed': false,
'favicon' : "img/favicon.ico"
}
}).placeAt('root');
</script>
</head>
<body class="sapUiBody" id="root">
</body>
</html>
这是我的清单文件app.appcache
(我在每个新版本都更改它)
CACHE MANIFEST
#APP VERSION 1.0.4-rc4
#insert here files to cache
#insert here files to NOT cache
NETWORK:
*
好的!但是现在我将应用程序复制到我的服务器上,然后 BOOM!某些页面已重新加载,但其他页面没有...(例如,我有一个登录 XML 视图,其中显示已更新的发布版本和未更新的设置对话框的 XML) 为什么我有这种行为?我希望浏览器在每次重新加载时重新加载每个文件
PS 如果我按 F5 手动重新加载应用程序,问题仍然存在。如果我在 index.html 文件中添加这些元标记,问题仍然存在
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
强制浏览器重新加载整个应用程序的唯一模式是手动取消缓存: