Angular服务工作者请求文件来自错误的URL
我在https:// myapp-fnl/#上托管了一个Angular 10 .NET应用程序,
该应用程序通过NGSW-Worker实现了禁止缓存的应用程序,我发现该应用程序无法正常工作。已注册了服务工人,我可以看到我的缓存文件,但是在释放新版本时尝试下载更新的文件时,它会失败。
您可以看到请求URL是https://myapp-fnl/ngsw.json?ngsw-cache-bust = 0.6 .....
但是,随后,NGSW-Worker试图尝试从我认为是错误的URL https://0-es2015.e6c ...中获取文件。 它会产生以下错误:
Driver state: EXISTING_CLIENTS_ONLY (Degraded due to failed initialization: Response not Ok (fetchAndCacheOnce): request for https://0-es2015.e6c696f9930a07feea1d.js/ returned response 504 Gateway Timeout
我相信正确的URL请求将是按照https://myapp-fnl/0-es2016.e6c的行为。
有人碰巧知道修改NGSW使用的URL的最佳方法吗?我的应用URL也有所不同。 ex(myapp-fnl,myapp-qc,myapp-prod)
谢谢
I have an Angular 10 .NET application hosted at https://myapp-fnl/#
The application has cache-busting implemented via an ngsw-worker that I discovered does not work properly. The service-worker is registered, and I can see my cached files, but when attempting to download updated files when a new version is released, it fails.
The cache busting request is as following :
As you can see the request URL is https://myapp-fnl/ngsw.json?ngsw-cache-bust=0.6.....
However, afterwards the ngsw-worker attempts to fetch the files from what I believe is the wrong URL https://0-es2015.e6c....
it produces the following error:
Driver state: EXISTING_CLIENTS_ONLY (Degraded due to failed initialization: Response not Ok (fetchAndCacheOnce): request for https://0-es2015.e6c696f9930a07feea1d.js/ returned response 504 Gateway Timeout
I believe the proper url request would be something along the lines of https://myapp-fnl/0-es2016.e6c....
Does anyone happen to know the best way to modify the URL that ngsw uses? My application URL also varies per enviornement. Ex (myapp-fnl, myapp-qc, myapp-prod)
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论