You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the course of #2486 I realized there are a lot of places where I end up writing url.origin === self.location.origin && ....
We could simplify this use case by passing in an additional parameter to the matchCallback function, sameOrigin, that's set to the result of evaluating url.origin === self.location.origin inside of the Router.
The text was updated successfully, but these errors were encountered:
The front end web app is https://bar-1.dev.foo.io/ but api calls(which I am trying to cache) are made to https://bar-api-1.dev.foo.io/v1/bedlist_providers?size=16.
The service worker runs with no complaints. It's just not caching the api as it should:
registerRoute(
/v1\/bedlist_providers\?size=/,
new StaleWhileRevalidate({
cacheName: 'providers-list'
}),
);
registerRoute(
/v1\/providers\/\d*\/bedlist\?size=/,
new StaleWhileRevalidate({
cacheName: 'bedlists'
}),
I believe it is because the api route origin is different than what it is registered to. Any ideas what I can do?
You can use a matchCallback as the first parameter to registerRoute() instead of a RegExp. That would probably end up being a lot cleaner for your use case.
In the course of #2486 I realized there are a lot of places where I end up writing
url.origin === self.location.origin && ...
.We could simplify this use case by passing in an additional parameter to the
matchCallback
function,sameOrigin
, that's set to the result of evaluatingurl.origin === self.location.origin
inside of theRouter
.The text was updated successfully, but these errors were encountered: