Angular Service Worker Request Files from Wrong URL

506 views Asked by At

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 : Cache-Busting Request Headers

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.... Invalid URL Request

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

0

There are 0 answers