Page disappears from cache after first redirect on chrome
Asked Answered
S

0

1

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

Surat answered 17/10, 2012 at 10:50 Comment(2)
Post your cache manifest. You should have the /offlinepage specified in the FALLBACK section. Then you will not need the javascript redirection as the offline page will be shown automatically. See whatwg.org/specs/web-apps/current-work/multipage/….Allpurpose
Filed it as a bug in chrome dev.Surat

© 2022 - 2024 — McMap. All rights reserved.