So there is detection like..
And guides to appcache like http://diveintohtml5.org/offline.html
But stil nobody knows the right way to offline enable your app.
Even yesterday a friend told me she thought one of native apps' hugest edges over web apps was that you can use them when you dont have connectivity.
Seems to me we need more guidance around dealing with flaky and non-connectivity... So perhaps proxies at the XHR level and such.. wycat's https://github.com/wycats/jquery-offline does a lot of this but there should be more.
I think the final deliverable here is some mix of library code (like jquery-offline) and a guide.
this series covers a lot of it: http://googlecode.blogspot.com/2009/06/gmail-for-mobile-html5-series-cache.html