Our team is handling discourse forums and its experiencing issues of duplicate requests on Chrome and not on Firefox or Safari. I suspect this issue to be related to service workers - workbox.
What does the setup look like?
- We have a domain → https://example.com
- scripts is hosted at a subpath → https://example.com/assets/myScript.js
- myScript makes a GET call to an external end point - https://foobar.com/
Whats the issue?
- When I visit the forums for the first time (or hard refresh), a single request is sent from the browser.
- Upon second request, two requests are sent from the browser. One from the file which is served from the service worker and one from fetchWrapper.mjs - https://github.com/GoogleChrome/workbox/blob/194cdeb63d5abb21490f88f01f02f4bcf7e6d54b/packages/workbox-core/_private/fetchWrapper.mjs#L111
How can we fix this?