问题
I have a major problem with service workers, or what I think is a service worker related problem. The problem I have (only in Safari) both on Mac and iOS is that every second time I visit a route I got a 504 (Gateway Timeout) message in the console and no data is fetched from the server.
Thanks in advance,
Mattias
回答1:
Disabling etag
from server side fixed my issue.
回答2:
I was having the same problem, and I was able to fix this by delaying the API call (in a component) to be executed 300 milliseconds after the page reload. So my code looks like the following:
ngOnInit() {
setTimeout(this._sendRequest.bind(this), 300);
}
来源:https://stackoverflow.com/questions/55807293/service-worker-in-safari