Re: [w3c/ServiceWorker] Declarative routing (#1373)

@Pajn

The difference between service worker and other routing systems is that service worker handles requests to other origins. If you create a system that only matches on URL path, would you expect that to match on any origin?

At some point it'd be nice to standardise Express-style path matching, but I don't think we'll do that as part of v1. The benefit of `{ url: { startsWith: '/articles/' } }` is we can resolve that string against the service worker's URL, as we do with URLs passed to `fetch()`.

We could also add things like `{ url: { pathStartsWith: '/foo/' } }` to match against particular components of the URL, but you'd be matching against all origins unless you specify otherwise.

> What if there is a hash in the url for example?

That's a good question. We flip-flopped on that a bit and I can't remember where we landed.



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

Received on Tuesday, 8 January 2019 13:54:31 UTC