tgvashworth / ServiceWorker-Polyfill

[DEPRECATED] JavaScript ServiceWorker implementation, enabling exploration by authors.
66 stars 7 forks source link

Check if failed cache installation stops worker installing #43

Open ahume opened 10 years ago

ahume commented 10 years ago

... even if the install event does not wait for a ready().

Currently a DNS lookup error for one item in one cache causes the whole installation to fail. The cache should fail atomically, but the worker installation should still succeed.

tgvashworth commented 10 years ago

I'm not sure this is correct – if the worker install waits on the ready caches then it should fail. Is there some reference to this in the spec?

ahume commented 10 years ago

Oh yes, true, have updated the issue. I'll test without waiting for ready.

Also, what's the use-case for not waiting for a cache to be ready?

jakearchibald commented 10 years ago

@ahume Imagine a game with a cache for core stuff, then a cache per level for level-specific stuff.

You'd probably waitUntil the core and level1 caches are ready, but happily let other levels download in the background. If the user loses connectivity, you can still offer them the offline experience for level1 and whatever else made it through before the connection went.