Re: [slightlyoff/ServiceWorker] Never fail for navigation requests (#892)

> We do not set any cache headers to SW file

Best not to leave it to heuristics, and set `Cache-Control: no-cache`.

> Fail means rejected promise as I wrote in parentheses.

So that wouldn't "fix" problems with `event.respondWith(cache.match(…))` if it resolved with undefined. Or `event.respondWith(new Promise(() => {}))`.

> Thing is, website can stuck forever if I do this `e.responseWith(caches.match(...));`

It shouldn't be. Trying to call `e.responseWith` will throw since it isn't a function, and the handling of the event will be aborted, and the request will be handled as if SW wasn't involved.

My attitude to this so far has been "Well, if developers screw up their server code, they users get a broken (or no) experience, why should service worker be different?", but I guess different browsers and evolving support makes it different.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/892#issuecomment-217633121

Received on Saturday, 7 May 2016 12:45:53 UTC