1

I need to create a web application with offline support. When the client's computer goes offline, Javascript must redirect to another page with important information from the application.

Redirect to offline webpage

window.addEventListener("offline", function(e) {
   document.location.href='/offline/index.html';
}
, false);

How to force save page /offline/index.html in the browser's cache to make sure that the content will be available when the internet connection is broken?

The /offline/index.html page will be updated every 10 minutes (if the app is online) and the cache must be still refreshed.

--

I tried to use cache manifest in the main app's html, but this is not working correctly. The offline page was saved, but other pages in online mode are saved too. I need to cache only one file, offline/index.html, and I prefer to manually redirect to the offline page with a Javascript event without HTML5 offline solutions.

My cache manifest file:

CACHE MANIFEST

/ff/landing/js/jquery.min.js
/ff/default/js/online.js

FALLBACK:
/ /offline/index.html

NETWORK:
*
dda
  • 6,030
  • 2
  • 25
  • 34
Dominik
  • 71
  • 1
  • 7

1 Answers1

0

You can use HTML5 Manifest.

see below links

http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html

http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html

How should I structure my HTML5 manifest given these requirements?

Community
  • 1
  • 1
thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
  • I tried to use this solution but this not working correct. I prefer to manual redirect to offline page with Javascript event, without HTML5 offline solutions. – Dominik May 24 '12 at 16:49