我正在阅读有关我的网站的缓存清理和更新的内容,我只是无法弄清楚下面使用清单或此功能的不同之处:
// Check if a new cache is available on page load.
window.addEventListener('load', function(e) {
window.applicationCache.addEventListener('updateready', function(e) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
// Browser downloaded a new app cache.
if (confirm('A new version of this site is available. Load it?')) {
window.location.reload();
}
} else {
// Manifest didn't changed. Nothing new to server.
}
}, false);
}, false);
link:https://www.html5rocks.com/en/tutorials/appcache/beginner/