我有一个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",
'[email protected]' : "img/114_logo.jpg",
'tablet' : "img/72__logo.jpg",
'[email protected]' : "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:
*
OK!但是现在我在我的服务器和BOOM上复制应用程序!某些页面被重新载入,但其他页面不会被载入...(例如,我有一个登录XML-view,其中显示已更新的发行版本以及未更新的设置对话框的XML) 为什么我有这种行为?我希望浏览器在每次重新加载时重新加载每个文件
P.S. 如果我用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" />
仅模式浏览器,迫使整个应用程序的重新加载,取消手动缓存:
又是什么问题?您正在讨论使用F5刷新浏览器。如果应用程序缓存按预期完成,则F5刷新不应从服务器获取新版本。这是应用程序缓存的重点! –
当我测试时,我通常会打开Chrome控制台并在网络选项卡 – Jorg
中勾选“禁用缓存”框。也许我找到了问题.. [link](https://developer.mozilla.org/en- US/docs/Web/HTML/Using_the_application_cache#Example_1_a_simple_cache_manifest_file) 红色消息显示:“重要提示:请勿在缓存清单文件中指定清单本身,否则几乎不可能通知浏览器新的清单可用。 也许在过去,我已经将appcache文件插入appcache ... O_o – padibro