I have to build a web app that is fully useable in remote/field/offline environments It looks like HTML5 supports an "offline mode" with a pretty sophisticated caching mechanism.
A few questions:
- Beyond caching JS/CSS/image resources, I also need a way to stub/mock/re-route async/ajax calls made after the pages "download". For instance, in "online mode", if the user clicks a button, this would normally send an HTTP POST to the server. But in "off-line mode", I need it to somehow store a stubbed/mocked version of the HTTP POST somewhere locally. Then, when the user resumes "online mode" the app would be intelligent enough to query the cache and fire off the request. Is this possible? If so, what is this mechanism called, and where is it documented?
- How are laymen end users expected to find offline HTML5 apps?!? They will know to go to
http://www.myapp.example.comin "online mode", but while "off-line" they would normally need to go to some browser URL beginning withfile:///some/path/on/their/system/to/the/cached/offline/app, right? Does HTML5 have anything to make this more "user friendly"? For instance, in offline mode could a user still go to the normal online URL (myapp.example.com) but then the browser automatically detects the network outage, and serves back whatever it has in its cache? Or something like that?