Re: [whatwg/streams] Meta: add a service worker to the spec (#637)

As always, the trickiest bit of offline-first is the UI. Some thoughts for how it could work:

1. Race the network & cache for a short amount of time (1 second?).
1. If the network wins - excellent! Serve it. Done!
1. if the cache wins, include UI that shows the date the content was last fetched, and a spinner while it's fetching.
1. If fetching fails, hide the spinner and notify the user.
1. If fetching succeeds:
  1. If the document hasn't been updated, hide the spinner, notify the user. Done!
  1. If the document has been updated, notify the user and give them a button to refresh the page.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/637#issuecomment-270391258

Received on Wednesday, 4 January 2017 15:03:02 UTC