Service worker in Safari

此生再无相见时 提交于 2019-12-07 10:05:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!