drupal analytics

http://chiuki.github.com/mobile-caching-strategies

Always connected?

Design for offline from the get go

  • Snappy UI
  • Much harder to retrofit later

Data availability tiers

Installed

Always there

Permanently cached

Downloaded on first use, kept until updated or deleted by user

Temporarily cached

Stored in cache directory, periodically cleared (by system or app)

Never cached

Needs internet to work

Which tier?

  • First use
  • Offline experience
  • Data expiration rate
  • Storage constraints

Data fetching

  • Background thread
  • Placeholder
  • Breadth first
  • Splash screen

Offline-generated data

  • Stored locally, then upload
  • Append only

The devil is in the details

Case studies

Monkey Write

Learn to write Chinese

Installed

Workbooks installed on device

Permanently cached

Workbook catalog (Bookstore)

Temporarily cached

Workbook cover images

Never cached

Workbook purchasing

Monkey Write: Bookshelf

Monkey Write: Bookshelf data

Monkey Write: Bookshelf with text

Monkey Write: Google Play

Monkey Write: No connection at Google Play

Offlane

Offline newsreader

Installed

None

Permanently cached

Sources

Temporarily cached

Articles, images

Never cached

None

Offlane: Sources

  • Not bundled with app
  • Client tells server what it got, server returns new sources
  • Pre-computed list on first use for speed
  • First use: Display login screen while fetching in background

Offlane: Sources

Offlane: Breadth first fetch

  • All sources in one text batch
  • 30 articles per source, text only
       Small groups (3 cycles)
       Round robin
  • Images last

Offlane: Articles

Offlane: Sync

  • How much storage?
       Number of days
       Max articles per source
  • Sync on app launch
  • Reachability API and heart beat while in foreground
       Sync every 5 minutes while online

Offlane: Sharing

Offlane: Sharing

  • Compose offline
  • Pre-shortened urls
  • Queue for upload later

Triposo

Offline guidebook

Installed

List of guidebooks, introductions

Permanently cached

Guidebook articles, maps

Temporarily cached

Weather and currency rate

Never cached

None

Triposo: List of guidebooks

Triposo: Netherlands download

Triposo: Currency update

Triposo: Environmental data

  • Sync on app launch
  • If no connection,
      Keep currency rate
      Remove weather

Triposo: Guidebook and map

  

Triposo: Check in

  • Save locally
  • Upload later
  • Append only

Triposo: Edit details

  

Triposo: Merge from multiple sources

Save user edits in append-only log

Design for offline from the get go

Installed

Always there

Permanently cached

Downloaded on first use, kept until updated or deleted by user

Temporarily cached

Stored in cache directory, periodically cleared (by system or app)

Never cached

Needs internet to work

Acknowledgements

Thank you!