[WikimediaMobile] Caching in Android / PhoneGap app

Brion Vibber bvibber at wikimedia.org
Sat Dec 10 01:10:44 UTC 2011


On Fri, Dec 9, 2011 at 4:48 PM, Brion Vibber <bvibber at wikimedia.org> wrote:

> On Fri, Dec 9, 2011 at 4:15 PM, Brion Vibber <bvibber at wikimedia.org>wrote:
>
>>
>> To ensure that bookmarked or 'saved' pages are consistently available,
>> either a homebrew loader cache with some smarts or something like the
>> existing URLCache should help; but it'd need to be changed to handle images
>> better etc.
>>
>> I prefer the homebrew loader cache, since it allows standard HTML
>> security separations to stay in effect (assuming PhoneGap doesn't disable
>> them all, which it might considering that the file: pages can do anything
>> to the iframe).
>>
>
> Bad news: that (WebViewClient.shouldInterceptRequest) seems to only be
> available on Android 3 and later. Manually loading as with URLCache should
> work though. Sigh...
>

Good news: good results so far using URLCache plugin to save just the
bookmarked pages.

Pushed to same branch:
https://github.com/brion/Wikipedia/commits/cache-setcachemode

Likely next steps on the cache front:
* make sure things work consistently ;)
* make bookmarked pages update in UrlCache when we load them again
* make bookmarks/saved pages list searchable when offline
* highlight bookmarked/saved pages in search results, history
* consider if renaming 'bookmarks' to 'saved pages' would make more sense
* make UrlCache usage behave nicer for bookmark saves -- there are flashes
as images and styles load, etc, probably due to the way things get loaded
in separate pieces (switch to XHR and preload the styles?)
* (Java side?) make sure we understand the cache size limits on UrlCache
* ensure that UrlCache is safe-ish
* (Java side) see if we can switch in the 'load from cache first' mode only
when offline

And related:
* general bookmarks cleanup & testing
* general history view cleanup & testing

-- brion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/mobile-l/attachments/20111209/1141a456/attachment.htm 


More information about the Mobile-l mailing list