이 브라우저는 예상되는 동작입니까?
실제로 의도 된 동작입니다. 내가 생각할 수 http://diveintohtml5.info/offline.html#debugging
if even a single resource listed in your cache manifest file fails to download properly, the entire process of caching your offline web application will fail. Your browser will fire the error event, but there is no indication of what the actual problem was.
하나 개의 솔루션이 (가) window.applicationCache.status
는 checking
또는 downloading
중 하나 인 경우 beforeunload
확인하는 것입니다 참조하십시오.
error
이벤트 (아래 참조)를 사용하여 마지막 시도가 성공하지 못했음을 나타내는 플래그를 사용자 localStorage에 설정하고 모든 것이 성공적으로로드 될 때까지 파일을 다시 페치 할 수 있습니다.
캐시 할 항목이 많은 경우 진행률 표시 줄과 페이지로드 중 사용자에게 인내심을 요구하는 텍스트를 표시 할 수 있습니다. 진행률 표시 줄의 경우 캐시 처리 기능의 progress 이벤트에 event.loaded
및 event.total
을 사용할 수 있습니다.
var appCache = window.applicationCache;
// Fired after the first cache of the manifest.
appCache.addEventListener('cached', handleCacheEvent, false);
// Checking for an update. Always the first event fired in the sequence.
appCache.addEventListener('checking', handleCacheEvent, false);
// An update was found. The browser is fetching resources.
appCache.addEventListener('downloading', handleCacheEvent, false);
// The manifest returns 404 or 410, the download failed,
// or the manifest changed while the download was in progress.
appCache.addEventListener('error', handleCacheError, false);
// Fired after the first download of the manifest.
appCache.addEventListener('noupdate', handleCacheEvent, false);
// Fired if the manifest file returns a 404 or 410.
// This results in the application cache being deleted.
appCache.addEventListener('obsolete', handleCacheEvent, false);
// Fired for each resource listed in the manifest as it is being fetched.
appCache.addEventListener('progress', handleCacheEvent, false);
// Fired when the manifest resources have been newly redownloaded.
appCache.addEventListener('updateready', handleCacheEvent, false);
function handleCacheEvent(e){
if(e.type && (e.type=='progress' || e.type=='ProgressEvent')){
console.log('percent:', Math.round(e.loaded/e.total*100)+'%', 'total:', e.total, 'loaded:',e.loaded);
}
}
AppCache 업데이트는 전체적으로 캐시되거나 아무것도 캐시되지 않습니다. – robertc
필자가 본 Tablet에서 자산의 부분 집합을 dl 할 수는 있지만 모두가 dl'd되지 않으면 오프라인 기능이 작동하지 않습니다. 로그인 페이지를 탐색 한 다음 웹 사이트 설정보기를 통해 내 앱에서 사용중인 저장 공간의 양을 확인할 수있었습니다. dl'ing 자산의 중단/불완전한 경우에보고 할 API가 노출되지 않은 것처럼 보입니다. 오프라인 기능을 보장 할 수있는 유일한 방법은 캐시 이벤트가 시작될 때까지 사용자가 로그인 페이지를 탐색하지 못하게하는 것입니다. 나는 아이디어가 열려 있습니다. –