Page disappears from cache after first redirect on chrome

余生长醉 提交于 2019-12-11 13:38:59

问题


I am trying to divert the user to an offline page when he comes to my site and the device is currently offline.

The problem is I trigger the caching from the home page itself so the problem is when the user comes to my url he comes to the loading page itself and not the offline page I would like him to go to.

What I do is using js redirect the user if the manifest is not available

function errorCache(event) {
//Redirect for error event of manifest
var offlineURL = 'http://myUrl/OfflinePage'
window.location = offlineURL;
} 

window.applicationCache.addEventListener("error", errorCache, false);

Now this works perfectly the first time the user goes to the page. The next time I go to the homepage though, it redirects me to the offline page, but the offline page is not available anymore.

Any idea if this is a chrome issue or a HTML5 behavior and how can I retain the offline page?

thanks

来源:https://stackoverflow.com/questions/12932685/page-disappears-from-cache-after-first-redirect-on-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!