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