I&#39;m having some positive results in preliminary tests simply switching the cache mode on the WebView.<br><br>Getting rid of the urlcache bits which we&#39;ve had problems with, and adding this into WikipediaActivity.java.onCreate():<br>
<br>        this.appView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);<br><br>lets me go back to previously-visited pages without complaint after switching on airplane mode -- and very quickly!<br><br><br>
However, any loading that *fails* (such as a page that hasn&#39;t been cached) triggers an application-fatal error, as far as I can tell because DroidGap assumes that iframes don&#39;t exist and the only thing that might fail to load is the entire application. :P This may just have to be hacked around by modifying the phonegap infrastructure. :P<br>
<br><br>Some potential issues with this approach:<br>* not sure if/how to control the amount of space used for caching<br>* (though you should be able to clear it manually from the standard Manage Applications panel on the phone)<br>
* presumably we should load from network first if we&#39;re online, so would need to swap this mode dynamically or else find a better behavior<br>* not sure if any way to tell what&#39;s in cache ahead of time<br>* of course since it&#39;s platform-dependent, similar behavior would need to be tweaked on other platforms<br>
<br><br><br>A couple other possibilities include:<br><br>1) Making an &quot;HTTP caching proxy&quot;-like layer that we slide under the ability to override how requests are made.<br><br>Again, this would be platform-specific and may need to be reimplemented in the backend for other platforms. Advantage: makes our JS-side code super easy as it would just try to load things and they&#39;d show up. We can control the return results, so errors wouldn&#39;t have to trigger the fatal code as above.<br>
<br><br>2) Do platform-independent &#39;caching&#39; by slurping the contents of pages within JavaScript after loading, and managing the re-loading from cache ourselves when offline<br><br>* Still needs the android fix for not dying when a connection fails. :P<br>
* may not be able to handle images this way<br>* could explode with JS stuff :)<br><br>-- brion<br><br>