Re: [ServiceWorker] should update on navigation or the subsequent updatefound event be delayed until document DOM is loaded? (#788)

I think that case is a race between two different operations.  I'm not sure devs would expect to duplicate those conditions often.

The update on navigate, though, is a very repeatable use case.

FWIW, in gecko we have implemented a 1 second delay after document load event.  For non-navigation events that trigger an update we fire them 1 second after the event.  One an update check is scheduled, any further update checks are coalesced into that currently scheduled timer.  We don't push back the timer, though, so that we are guaranteed to fire the update regardless of how many events the SW is receiving.

I think this is close to what chrome is doing, but not 100% sure.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/788#issuecomment-173799863

Received on Friday, 22 January 2016 03:59:33 UTC